比如下面的代碼
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript" src="jquery.min.js"></script>
<script language="javascript">
$(document).ready(function(){
var hy=document.getElementById("p1").textContent
var hg=document.getElementById("button1").value
$("#button1").click(function(){
$('#div1').load('limeng.asp?nm='+hy);
});
});
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>
</head>
<body>
<button id="button1" type="button" value="68888">hgjg</button>
<div id="div1">這裡現在是空的</div>
<p id="p1">zenmjgjjgjg</p>
</body>
</html>
用選擇選擇符號是無法獲取的,$("#p1").textcontent,以及$("#button1").textcontent,而是使用最基本的getElementById方法,因此,使用$應該怎樣獲取呢,請相關朋友回答下哈,謝謝
var hy=$('#p1').text();//document.getElementById("p1").textContent
var hg=$('#button1').val();//document.getElementById("button1").value