1Learn jquery
val() can take a value; val(s) can be assigned a value
Value Assignment
Expand
<script></script><script> <BR><!-- <BR>$(document).ready(function(){ <BR>$("#get").click(function(){ <BR>$("#test").html("我是input的值:"+$("#mm").val()) <BR>}) <BR>$("#put").click(function(){ <BR>$("#mm").val("val()真好用") <BR>}) <br><br>$("#an").click(function(){ <BR>var a=$("#an").val()=="展开"?"缩进":"展开" <BR>//$("#an").val(a) <BR>if(a=="展开"){ <BR> $("#test").slideUp("slow",function(){$("#an").val(a)}); <BR>//$("#test").fadeOut("fast",1000); <BR>// $("#test").fadeIn("fast",500) <BR>} <BR>else{ <BR>$("#test").slideDown("slow",function(){$("#an").val(a)}); <br><br>//$("#test").fadeOut("fast",1000); <BR>//$("#test").fadeOut("slow",500) <BR>} <BR>}) <BR>$("span").css({background:'black',color:"red"}) <BR>//is叛断 <BR>$("button[@id='get']").parent().is("div") <BR>$("#test").html("css();animate()") <BR>$("div#test").css({ left: 10,height:200,width:200,background:"black",color:"white"}); <BR>$("div#test").animate({ left: 500, opacity: 'show' }, 500); <br><br><BR>}); <br><br><br><br>function aiqi(){ <BR>$("#mm").val("asdasd") <BR>$("p").css("color","red") <BR>$("div#test").background("gray") <BR>$("div#test").css("color","yellow"); <BR>$("div#test").css({width:"200",height:200}) <BR>$("div#test").html($.browser.msie) <BR>//$("#mm").click(function{alert()}); <BR>$("#test").fadeOut("fast",1000); <BR>$("p").fadeTo("slow", 0.5); <BR>$("#test").fadeIn("slow",0.5,function(){ alert("Animation Done."); }); <BR>$.each( [0,1,2], function(i){ alert( "Item #" + i + ": " + this ); }); <BR>$("p").slideDown("slow",function(){ alert("Animation Done."); }); <BR>} <br><br>//aiqi(); <BR>//$("p").mousedown();//$("img").oneload( function() { alert("Hello"); } ); <br><br>//$.getScript("test.js",function(){ <BR>//alert(obj.name)}) <BR>//$.getJSON("test.js", function(obj){ alert(obj.name);}) <BR>//--> <BR></script>
Statement: The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn