Question: Please Help convert javascript to jquery! jQuery Practice Modify your Lab 1 assignment to use jQuery. Be sure to use jQuery for: Registering all events
Please Help convert javascript to jquery!
jQuery Practice Modify your Lab 1 assignment to use jQuery.
Be sure to use jQuery for:
Registering all events
Selecting any elements
Modifying the contents or attributes of any elements
None of the script code should appear within the HTML body.
function ChangeColor(){
var favColor=document.getElementById('fav_color').value;
document.body.style.backgroundColor = favColor;
var nextFavColor=document.getElementById('next_fav_color').value;
var inputFields=document.getElementsByTagName("input");
for(var i=0; i
if(inputFields[i].type == "text"){
inputFields[i].style.backgroundColor=nextFavColor;
}
}
var image1Id= document.getElementById("image1");
image1Id.onmouseover=function(){
image1Id.src = "cat.jpg";
}
image1Id.onmouseout = function(){
image1Id.src = "grumpyCat.jpg";
}
var favNumber=document.getElementById('fav_num').value;
var numbers="";
for(var i=1;i
numbers+=favNumber+" ";
}
document.getElementById('p').innerHTML =numbers;
}
Change values on button click
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
