i have a code here
is this possible to add another emotions hereCode:<html> <head> <title>Javascript - Emotions</title> <script type="text/javascript"> function emotions() { var t1=setTimeout("document.getElementById('emotion1' ) .innerHTML='Happy' +document.getElementById('name').value",1000); var t4=setTimeout("document.getElementById('thankyou') .innerHTML='Thank You'",2000); } function clearText() { document.getElementById('name').value=''; document.getElementById('emotion1').innerHTML=''; document.getElementById('thankyou').innerHTML=''; } </script> </head> <body> <form> <input type="text" id="name"> <input type="button" value="Submit" onClick="emotions()"> <input type="button" value="Clear" onClick="clearText()"><br /> <p id="emotion1"></p> <p id="emotion2"></p> <p id="emotion3"></p> <p style="padding-left:2em" id="thankyou"></p> </form> </body> </html>
? because i like to lessen my work..example isCode:("document.getElementById('emotion1' ) .innerHTML='Happy'? i try this but no lucky at allCode:.innerHTML='Happy' 'Sad'
creating many lines of codes looks my notepad like scratch paperCode:var t1=setTimeout("document.getElementById('emotion1' ) .innerHTML='Happy' +document.getElementById('name').value",1000);.. please help me



Reply With Quote
Bookmarks