Home > Article > Web Front-end > Personal experience using jQuery_jquery
$("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_id