Get the value:
The label tag is used in JS and Jquery and cannot be used to get its value like other tags:
var label=document.getElementById("id");
var value=label.value;
var value=$("#id ").val();
can be like this:
JS:
var label=document.getElementById("id");
var value=label.innerText;
Jquery:
var value=$("#id").html() ;
Assignment:
Unlike Java, JS and Jquery cannot assign value like this:
var label=document.getElementById("id");
var value=label.innerText;
value="XXXXXX";
var value=$("#id ").html();
value="XXXXXX";
can be assigned like this:
var label=document.getElementById("id");
label.innerText="XXXXXX";
$("#id") .html("XXXXX");
Statement: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