Write a JavaScript that handles following mouse events. Add necessary elements. (i) JavaScript gives the key code for the key pressed. (ii) If the key pressed is the script should announce that vowel is pressed. (iii) When the key is “a”,”e”,”i”,”o”,”u”, released background should change to blue. <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=iso-8859-1" /> Document</title> <script type="text/javascript"> window.onkeyup = changebgcolor; function myKeyPress(e){ var keynum; if(window.event){ // IE keynum = e.keyCode; }else if(e.which){ // Netscape/Firefox/Opera keynum = e.which; } var char1=String.fromCharCode(keynum); //for if(char1=='a' || char1=="e" || char1=='i' || char1=='o' || char1=='u') { alert("you have pressed vovel");
Write a JavaScript that handles following mouse events. Add necessary elements. (i) JavaScript gives the key code for the key pressed. (ii) If the key pressed is “a”,”e”,”i”,”o”,”u”, the script should announce that vowel is pressed. (iii) When the key is released background should change to blue. <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=iso-8859-1" /> Document</title> <script type="text/javascript"> window.onkeyup = changebgcolor; function myKeyPress(e){ var keynum; if(window.event){ // IE keynum = e.keyCode; }else if(e.which){ // Netscape/Firefox/Opera keynum = e.which; } var char1=String.fromCharCode(keynum); //for if(char1=='a' || char1=="e" || char1=='i' || char1=='o' || char1=='u') { alert("you have pressed vovel");
javascript_gtu_solved_example.docx