Author name: Jancy J

Input value from the user using prompt html-js

Input value from the user using prompt html-js. <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <title>User Input with Prompt</title> </head> <body> <button onclick=”getUserInput()”>Enter Your Name</button> <p id=”userInputDisplay”>Your name will appear here.</p> <script> function getUserInput() { // Prompt the user for input var userInput = prompt(“Please enter your name:”); if (userInput !== …

Input value from the user using prompt html-js Read More »

Create an object and display its content in a table.

Create an object and display its content in a table. <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <title>Display Object in Table</title> <style> table { width: 50%; border-collapse: collapse; margin: 20px 0; } table, th, td { border: 1px solid black; } th, td { padding: 8px; text-align: left; } </style> </head> …

Create an object and display its content in a table. Read More »

How to create a bold text using javascript.

How to create a bold text using javascript. <! Doctype html> <html lang=”en”> <head> <title> make a text bold using javascript</title> </head> <body> <p id=”mytext”> this is some text </p > <!DOCTYPE html> <html lang=”en”> <head>     <meta charset=”UTF-8″>     <meta name=”viewport” content=”width=device-width, initial-scale=1.0″>     <title>Make Text Bold with JavaScript</title> </head> <body>     <p id=”myText”>This is some text.</p>     <button onclick=”makeTextBold()”>Make Text Bold</button>     <script>         function makeTextBold() {             var element = document.getElementById(“myText”);             element.innerHTML = “<b>” + element.innerHTML + “</b>”;         }     </script> </body> </html>  

Scroll to Top