开发者

onkeypress , onkeyup are not working in textarea.

开发者 https://www.devze.com 2023-03-01 07:26 出处:网络
<textarea name=\"textarea\" cols=\"20\" rows=\"5\" id=\"controller-about-information-about\" onKeyDown=\"callname1(this.value);\" onKeyPress=\"callname1(this.value);\" onKeyUp=\"callname1(this.valu
<textarea name="textarea" cols="20" rows="5" id="controller-about-information-about" onKeyDown="callname1(this.value);" onKeyPress="callname1(this.value);" onKeyUp="callname1(this.value);"></textarea>
<script>
    function callname1(str) {
        alert(str);
        alert("this is textarea");开发者_JAVA技巧

    }
</script>


If you are doing it in an XHTML document, all attribute names have to be in lowercase (see http://www.w3.org/TR/xhtml1/diffs.html#h-4.2) if you want the document to be valid. I am not sure if it makes your code "not working".

0

精彩评论

暂无评论...
验证码 换一张
取 消