如何取得当前点击的div的值
展开全部
代码
<script language="JavaScript">
function SendAJAX()
{
if (document.getElementById("qq").value != "" && document.getElementById("one").id !="")//这里只能指定一个,点击哪个就取哪个的div的id
{
var DataToSend = "qq=" + document.getElementById("qq").value + "&id=" + document.getElementById(this).id;
var xmlhttp = false;
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlhttp.open("POST","receive.asp",false);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send(DataToSend);
}
}
<script language="JavaScript">
function SendAJAX()
{
if (document.getElementById("qq").value != "" && document.getElementById("one").id !="")//这里只能指定一个,点击哪个就取哪个的div的id
{
var DataToSend = "qq=" + document.getElementById("qq").value + "&id=" + document.getElementById(this).id;
var xmlhttp = false;
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlhttp.open("POST","receive.asp",false);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send(DataToSend);
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询