Note and the Pure JS operation difference, one is the object, one is a string, the following description:
In jquery, use $ ("#id") to get the input element of the page, which is equivalent to document.getElementById ("element") However, it is a jquery object instead of a DOM The element object. Value is a property of the DOM element object. Therefore, use $ ("#id"). Value cannot be taken as a value by the following method:
var job_name = $ ("#id_jenkins_job") [0].value;$ ("#id_develop_version") [0].value = JSON;
Change after the output box changes:
$ ("#address"). Focus (function() {//Address box get mouse focus varTxt_value = $ ( This). Val ();//get the value of the current text box if(Txt_value = = "Please enter your email address") { $( This). Val ("");//empty the contents of the text box if the condition is met }});$("#address"). Blur (function() {//Address box loses mouse focus varTxt_value = $ ( This). Val ();//get the value of the current text box if(Txt_value = = "") { $( This). val ("Please enter your email address");//If the condition is met, the content is set }})
Assignment and value operation of txt type with jquery as input