有什么办法可以给htc文件中的函数传参数吗?(请高手指点) 在htc中,element代表执行htc的源对象在这里,element代码双击的divfunction selectText(id) { alert(element.id);} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可是为什么 alert(document.getElementById(element.id))的结果却是null呢 <PUBLIC:ATTACH EVENT="ondblclick" ONEVENT="selectText()"/><SCRIPT LANGUAGE="javascript"> function selectText(id) { alert(element.id) alert(parent.document.getElementById(element.id).innerHTML)} </script> 先无限感激一下2位的热心指导,再皮厚厚的问一下为什么1: function selectText() {2: var selId=parent.document.getElementById(element.id).innerHTML;3: var r = document.body.createTextRange();4: alert(selId)5: r.findText(parent.document.getElementById(element.id).innerHTML);6: r.select()7: } 运行到第5句还是通不过呢,提示未指明错误 我想要的效果就是双击某个div区的时候,可以自动选定该区文本 和前面的一样,document必需来自window对象的引用var r = parent.document.body.createTextRange() 可以直接用顶层对象window即window.document.....不可直接用document.... 有关jquery的标签选择问题。 请问如何取得“层”下,div样式名个数? js 弹出层的问题 比较两数大小第2 只用html+javascript能进行权限的控制吗? 高分向各位高手请教,使用IE自带打印功能,请问怎样才能打印时不出现框架结构(或者去掉框架的边框呢)? 为什么 这个只能显示 而不能隐藏 求大虾看看那里错了 javascript读取本地文件 给某个指定的节点中插入最后一个子节点 到底啥是现代事件绑定 使用onunload事件时遇到的问题,请高手帮帮忙! 求救... iframe designMode 中 如何替换选中内容(有答案+100分)
alert(document.getElementById(element.id))
的结果却是null呢
<SCRIPT LANGUAGE="javascript">
function selectText(id) {
alert(element.id)
alert(parent.document.getElementById(element.id).innerHTML)
}
</script>
为什么
1: function selectText() {
2: var selId=parent.document.getElementById(element.id).innerHTML;
3: var r = document.body.createTextRange();
4: alert(selId)
5: r.findText(parent.document.getElementById(element.id).innerHTML);
6: r.select()
7: }
运行到第5句还是通不过呢,提示未指明错误