1、获取input中属性value的值(value值属于input标签中的属性)
<span>
<input type="text" id="transport_no" value="12345" name="waybill_no">
</span>
js:
var span = document.getElementById("transport_no").value
jquery:
var span = $("#transport_no").val()
2、获取span的值(不属于span标签的属性,用innerHTML)
<span id="transport_no" name="waybill_no">
12345
</span>
js:
var span = document.getElementById("transport_no").innerHTML
jquery:
var span = $("#transport_no").html()