i have a code here
Code:
<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>
is this possible to add another emotions here
Code:
("document.getElementById('emotion1' ) .innerHTML='Happy'
? because i like to lessen my work..example is
Code:
.innerHTML='Happy' 'Sad'
? i try this but no lucky at all
Code:
var t1=setTimeout("document.getElementById('emotion1' ) .innerHTML='Happy'  +document.getElementById('name').value",1000);
creating many lines of codes looks my notepad like scratch paper .. please help me