
比如,\x0d\按钮\x0d\jquery: $("#sub")attr("class");\x0d\js: documentgetElementById("sub")attributes["class"]nodeValue;要放在body后面,不然获取不到
/
@see 鼠标点击拖拽的效果(页面可以同时拖动多个框)
@param boxId 整个对象(框)的id(一般为div或table)
@param event 内置对象(必须传入)
/
function mousePlead1(event, boxId) {
var o = getO(boxId);
var isIE = documentall true : false;
var e = event;
var x = eoffsetX || elayerX;
var y = eoffsetY || elayerY;
documentonmousemove = function(e) {
ostylefilter = 'Alpha(opacity=70)';
ostyleopacity = '07';
if (isIE) {
osetCapture();
} else {
windowcaptureEvents(EventMOUSEMOVE);
}
var e = windowevent || e;
if (eclientX - x >= 0 && eclientY - y >= 0 && eclientX - x <= getWinSize()[0] - getO(boxId)offsetWidth
&& eclientY - y <= getWinSize()[1] - getO(boxId)offsetHeight) {
ostyleleft = (eclientX - x) + "px";
ostyletop = (eclientY - y) + "px";
}
};
documentonmouseup = function(e) {
documentonmousemove = function() {
};
if (isIE) {
oreleaseCapture();
} else {
windowreleaseEvents(oMOUSEMOVE);
}
ostylefilter = "";
ostyleopacity = "";
};
}
/
@see 获得对象
@param id 对象的id(表单元素和其他标签都可以)
@return Object
/
function getO(id) {
return documentgetElementById(id);
}
/
@see 获得当前窗体的大小(width,height)
@return Array
/
function getWinSize() {
var width = parseInt(documentdocumentElementclientWidth);
var height = parseInt(documentdocumentElementclientHeight);
return new Array(width, height);
}
以上就是关于如何获取html元素对象属性的值全部的内容,包括:如何获取html元素对象属性的值、js怎样获取对象id值、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)