144
rated 0 times
[
145]
[
1]
/ answers: 1 / hits: 7814
/ 11 Years ago, tue, december 3, 2013, 12:00:00
For my code, I am trying to call 2 parameters into a function. Once you have left the 2nd input box, and multiply the 2 numbers passed through and put it in the third text box. if either of the first 2 input boxes are empty, then color them light red. This is my code so far, what am I missing?
Javascript:
function multiply(one, two) {
if(one==){
this.style.color='red';
}
if(two==){
this.style.color='red';
}
else{
txt1=one * two;
return txt1;
}
}
HTML5:
First Value: <input type=text name=mFirst />
Second Value: <input type=text name=mLast onblur=multiply(mFirst.value, mLast.value) />
Multiplication of First and Second Value: <input type=text name=answer>
More From » html