Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang = "en-US">
- <head>
- <meta charset = "UTF-8">
- <title>Inner.html</title>
- <script type = "text/javascript">
- //text box
- function sayHi()
- {
- var txtName = document.getElementById("txtName") ;
- var divOutput = document.getElementById("divOutput") ;
- var name = txtName.value ;
- divOutput.innerHTML = "<em>" + name + "</em>";
- divOutput.innerHTML = "is a very nice name.";
- }
- //end HI
- </script>
- <link rel = "stylesheet"
- type= "text/css"
- href = "textBoxes.css" />
- </head>
- <body>
- <h1>Inner HTML </h1>
- <form action = "">
- <fieldset>
- <label>Pleae type your name</label>
- <input type = "text"
- id = "txtName"/>
- <button type = "button"
- onclick = "sayHi()" >
- Click Me
- </button>
- </fieldset>
- </form>
- <div id = "divOutput">
- Watch this space.
- </div>
- </body>
- </html>
- The program should take name input and output "Maurice is a very nice
- name" */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement