<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Move Text Right to Left</title> <style> #sentenceDiv { border: 1px solid black; padding: 10px; margin: 20px; width: 300px; text-align: center; overflow: hidden; white-space: nowrap; background-color:green; } #sentence{background-color:red;} </style> </head> <body> <div id="sentenceDiv"> <p id="sentence"> </p> <button onclick="moveText()">मूव करें</button> </div> <script> function moveText() { var sentenceElement = document.getElementById('sentence'); var sentenceText = sentenceElement.innerText; var interval = setInterval(function() { sentenceText = sentenceText.substring(1) + sentenceText[0]; sentenceElement.innerText = sentenceText; }, 500); } </script> </body> </html>