|
<!DOCTYPE html> <html> <head> <style> p { color:blue; margin:8px; } </style> <script src="http://code.jquery.com/jquery-latest.js"></script> </head> <body> <input type="text" id="s1" value=""/> * <input type="text" id="s2" value=""/> = <input type="text" id="s3" value=""/> <script> var value1=0;var value2=0;$("#s1").keyup(function(){value1 = $(this).val(); $("#s3").val(value2*value1); });$("#s2").keyup(function(){value2 = $(this).val(); $("#s3").val(value2*value1); });</script> </body> </html> |
|