<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8"> <title></title> <Scriptsrc= "Js/jquery.js"></Script> <Script>window.onload= function(){ $('#btnok')[0].onclick= function(){ //1. Get the SRC attribute of the img tag //Alert ($ (' img '). attr (' src ')); //2. Setting the value of a property //$ (' img '). attr (' src ', ' images/2.jpg '); /*//3. Set multiple properties for IMG at the same time var data = {src: ' images/1.jpg ', Width: ' 150px ', Height: ' 190px '}; $ (' img '). attr (data); */ //4. Setting element properties by return value of a function /*$ (' img '). attr (' src ', function () {//return ' images/' + random number + '. JPF '; Return ' images/' +math.ceil (Math.random () *54) + '. jpg '; }); */ //5. Removing attributes from an element $('img'). Removeattr ('src'); } } </Script> </Head> <Body> <inputtype= "button"ID= "Btnok"value= "Property Action" /> <HR/> <imgsrc= "Images/1.jpg" /> <ul> <ol></ol> </ul> </Body></HTML><?PHP Header ("Content-type:text/html;charset=utf-8");
Kill Thunder Dog jquery---11 property operations