Saturday, 6 August 2022

Format text using JS

index.html

    <html >
    <body>
        <p id="p1"></p>
        <script>
            //format text using js
            document.getElementById('p1').innerHTML="<b>viva</b>";
            document.getElementById('p1').style.fontSize='40px';
            document.getElementById('p1').style.color='blue';
            document.getElementById('p1').style.background='red';
        </script>
    </body>
    </html>



No comments:

Post a Comment

Regular Expressions In JS

 index.html file <! DOCTYPE html > < html lang = "en" > < body > < script > let re ; re = /hello/ i ;  ...