تغییر استایل توسط جاوا اسکریپت
بازگشت به صفحه اصلی
بازگشت به صفحه مقاله
دو ستونی
دو سطری
اجرای کد RUN »
<!DOCTYPE html> <html> <body> <style> h1,p,button{direction:rtl;} </style> <h1>اولین جاوا اسکریپت من</h1> <p id="demo">جاوا اسکریپت می تواند استایل عناصر را تغییر دهد.</p> <script> function myFunction() { document.getElementById("demo").style.fontSize = "25px"; document.getElementById("demo").style.color = "red"; } </script> <button type="button" onclick="myFunction()">کلیک کن!</button> </body> </html>