$ (). Arr used

Source: Internet
Author: User

$("#handmoney").attr("readonly","readonly"); 只读
$("img").attr("width","180");设置图片宽度
$("img").attr({width:"50",height:"80"});设置宽和高
$("ul").attr("title","不吃橘子");
$("#accessory").css("display","none"); 隐藏
$("#accessory").css("display","block"); 显示
$("#handmoney").removeAttr("readonly"); 删除所有 #handmoney 元素的 readonly属性
$("p").hide(1000); 隐藏某段div

$(document).ready(function(){

$("button").click(function(){

$("#w3s").attr("href","http://www.w3school.com.cn/jquery"); 超链接

});
});


$(document).ready(function(){
$("button").click(function(){
$("#w3s").attr({
"href" : "http://www.w3school.com.cn/jquery/",
"title" : "W3School jQuery 教程"
});
});
});


$("#div1").remove() 删除div
$("#div1").empty(); 清空div内容
$("h1,h2,p").addClass("blue"); 给某个字体设置颜色
$("div").addClass("important"); 设置class 属性
$("h1,h2,p").removeClass("blue"); 删除元素
$("p").css("background-color","yellow"); 设置背景黄色
$("p").css({"background-color":"yellow","font-size":"200%"}); 背景黄色。字体加大

$("#div1").fadeOut();立即
$("#div2").fadeOut("slow");
$("#div3").fadeOut(3000); 3秒隐藏

$().arr使用

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.