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>

解决方案 »

  1.   

    DTD XHTML 1.0 Strict标准不支持expression表达式!!
    直接设置onclick事件不就行了么??
      

  2.   

    style="a {poorfish:expression(this.onclick=function kill(){return false})}'
    而且这边少了个{ 号
      

  3.   


    <!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>
    改成这样试试