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

Personal experience using jQuery_jquery

WBOY
Release: 2016-05-16 18:55:33
Original
895 people have browsed it

$("Tag name") //Get the html element document.getElementsByTagName("")
$("#ID") //Get a single control document.getElementById("")
$("div #ID ") //Get the control in a control
$("#ID #ID") // Get the control through the control ID
$("label.class style name") // Get it through class Control
$("#ID").val(); //Get value
$("#ID").val(""); //Assign value
$("#ID" ).hide(); //Hide
$("#ID").show(); //Show
$("#ID").text(); //Equivalent to taking innerHTML
$("#ID").text(""); //Equivalent to innerHTML=""
$("#ID").css("Attribute","Value") //Add CSS style
$("form#form id").find("#the control id found").end() //Traverse the form
$("#ID").load("*.html") / /Load a file
For example:
$("form#frmMain").find("#ne").css("border", "1px solid #0f0").end() // end ()Return form
.find("#chenes").css("border-top","3px dotted #00f").end()

$.ajax({ url: "Result .aspx", //The url of the data request page
type: "get", //Data transmission method (get or post)
dataType: "html", //The data format expected to be returned (such as " xml", "html", "script", or "json")
data: "chen=h", //parameter string for passing data, only suitable for get method
timeout:3000, //setting Time delay request time
success:function(msg)//Trigger function when the request is successful
{
$("#stats").text(msg);
},
error:function(msg) //Function triggered when the request fails
{
$("#stats").text(msg);
}
});
$( document).ready(function(){
$("#description").mouseover(function(){
//ajax method
$.get( "Result.aspx", //data request The url of the page
{ chen: "Test",age: "25"}, //Parameter string to pass the data
function(data){ alert("Data Loaded: " data); } //Trigger Function after /Get text value
or $("#testSelect").find('option:selected').text();
or $("#testSelect").val();
SELECT * FROM JOBS a WHERE not EXISTS(SELECT 1 FROM JOBS B WHERE a.job_idSELECT * FROM JOBS a WHERE EXISTS(SELECT 1 FROM JOBS B WHERE a.job_id

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