DOCTYPE 是必须加上的,不能去掉,但是加上就失效了,怎么办啊------------
要实现的功能:
要求点击按钮使得本来实效的链接有效注意 只能修改这里 document.getElementById('down_load_false').style.a='';style 必须放在<div id="down_load_false" 里面。谢谢!
--------------不加DOCTYPE 可以成功<html><head>
<script language="javascript">
window.onload = function() {
document.getElementById('btn').onclick = function() {
document.getElementById('down_load_false').style.cssText='a poorfish:expression(this.onclick=function kill(){return true})}';
}
}</script></head><body>
<div id="down_load_false" style="a {poorfish:expression(this.onclick=function kill(){return false})}">
<a href="http://www.163.com">www.163.com</a>
</div>
<input type="button" id="btn" value="接触锁定" /> </body></html>
加上DOCTYPE 就失效<!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">
<head>
<script language="javascript">
window.onload = function() {
document.getElementById('btn').onclick = function() {
document.getElementById('down_load_false').style.cssText='a poorfish:expression(this.onclick=function kill(){return true})}';
}
}</script></head><body>
<div id="down_load_false" style="a {poorfish:expression(this.onclick=function kill(){return false})}">
<a href="http://www.163.com">www.163.com</a>
</div>
<input type="button" id="btn" value="接触锁定" /> </body></html>
要实现的功能:
要求点击按钮使得本来实效的链接有效注意 只能修改这里 document.getElementById('down_load_false').style.a='';style 必须放在<div id="down_load_false" 里面。谢谢!
--------------不加DOCTYPE 可以成功<html><head>
<script language="javascript">
window.onload = function() {
document.getElementById('btn').onclick = function() {
document.getElementById('down_load_false').style.cssText='a poorfish:expression(this.onclick=function kill(){return true})}';
}
}</script></head><body>
<div id="down_load_false" style="a {poorfish:expression(this.onclick=function kill(){return false})}">
<a href="http://www.163.com">www.163.com</a>
</div>
<input type="button" id="btn" value="接触锁定" /> </body></html>
加上DOCTYPE 就失效<!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">
<head>
<script language="javascript">
window.onload = function() {
document.getElementById('btn').onclick = function() {
document.getElementById('down_load_false').style.cssText='a poorfish:expression(this.onclick=function kill(){return true})}';
}
}</script></head><body>
<div id="down_load_false" style="a {poorfish:expression(this.onclick=function kill(){return false})}">
<a href="http://www.163.com">www.163.com</a>
</div>
<input type="button" id="btn" value="接触锁定" /> </body></html>
解决方案 »
- 如何用js实现鼠标放在第一个菜单上时其子内容显示,第二个菜单隐藏,放在第二个菜单
- DWZ的创建表单元素问题
- 选择器中条件选择器的"!="是什么意思
- 如何限定录入框里只能输入数字,且小数点后只有一位数字
- jquerymultiSelect插件
- 一个Javascript解析Json的问题
- 谁给个带checkbox的树,在asp.net中
- 函数的问题
- 鼠标悬停触发事件,请教大虾
- ======================如何实现类似新浪网首页顶部只出现3秒就消失的大幅广告?==========================
- 求谷歌地图API KEY 加密函数如下面的getApiKey(),但有错
- JQuery怎么向上滚动一页,我的只能向上滚动一行
直接设置onclick事件不就行了么??
而且这边少了个{ 号
<!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">
<head>
<script language="javascript">
window.onload = function() {
document.getElementById('btn').onclick = function() {
document.getElementById('down_load_false').firstChild.href = "javascript:void(0)"; }
}</script></head><body>
<div id="down_load_false" style="a {poorfish:expression(this.onclick=function kill(){return false})}">
<a href="http://www.163.com">www.163.com</a>
</div>
<input type="button" id="btn" value="接触锁定" /> </body></html>
改成这样试试