本身input就有value属性,可能是你再定义一个value有冲突,不过我没有试,你可以换个属性名字试一试。

解决方案 »

  1.   

    try
    1.
    <html  xmlns:IE>
    <head><title>1231</title>
    <style type="text/css">
    @media all {
    IE\:ValueTag {
    behavior:url(value.htc);
    }
    }
    </style>
    </head>
    <body>
      
      <IE:ValueTag id="ddd" value="12345"></IE:ValueTag>
      <button onclick="alert(ddd.value)">GetValue</button>
      <button onclick="ddd.value='111'">PutValue</button>
    </body>
    </html>2. value.htc:
    <public:component>
    <public:property name="value" put="putValue" get="getValue"/><script language="javascript">
      element.innerHTML = "<input type='text' id='xxx'>";
      var sValue;
      function putValue(argValue) {
        sValue = argValue;
        window.document.getElementById('xxx').value = sValue;
      }  function getValue() {
        sValue = window.document.getElementById('xxx').value;
        return sValue + "Len";
      }
    </script>
    </public:component>
      

  2.   

    难道没有从DOM结构方面取得Value的方法吗?我用debugger;中断后查看ddd,发现value那一栏中还是用户输入的值,是不是说明可以用什么方法取得这个值和对这个值赋值呢?因为我更想使用一个input在主页面中而不是用一个IE:\...。
      

  3.   

    I do not think you can overloading an existing property
      

  4.   

    I do not think you can overload an existing property
      

  5.   

    if you reuse a property like "value", how do you access the old property "value"?