Home > Web Front-end > JS Tutorial > body text

SET and GET_jquery commonly used in jquery

WBOY
Release: 2016-05-16 18:56:35
Original
1206 people have browsed it

$("#msg").html(); //Return the html content of the element node with id msg.
$("#msg").html("new content");
//Write "new content" as an html string into the content of the element node with the id of msg, and the page will display bold new content

$(”#msg”).text(); //Return the text content of the element node with id msg.
$("#msg").text("new content");
//Write "new content" as a normal text string into the content of the element node with the id of msg, and the page will display new content

$(”#msg”).height(); //Return the height of the element with id msg
$(”#msg”).height(”300″); //Return the id to msg Set the height of the element to 300
$("#msg").width(); //Return the width of the element with id msg
$("#msg").width("300"); //Set the width of the element with id msg to 300

$("input").val("); //Return the value of the form input box
$("input"). val("test"); //Set the value of the form input box to test

$("#msg").click(); //Trigger the click event of the element with id msg
$(”#msg”).click(fn); //Add a function for the click event of the element with id msg

Similarly, blur, focus, select, and submit events can have these two calls method

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template