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>
解决方案 »
- 大神!为什么我的<body>里面的<img >图片显示不出来呢,难道是下面的js函数问题?
- iframe 操作
- asp中能否舍弃vbscript而只用javascript?
- 急急!!!请教一个简单的背景更换JS..在线等
- js 操作xml文件问题
- 关于JS instanceof 的问题
- 谁能提供两个js插件,一、全屏自适应焦点图切换插件,二、列表图hover滑出层插件,详细看正文
- 如何在一个页面里刷新其他不是通过window.open()打开的页面????
- 急!!!!!!在线等!
- 一个页面链接的问题
- 求谷歌地图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>
改成这样试试