开发者

How do I place focus on an element in dojo that only has a class and not an id

开发者 https://www.devze.com 2023-01-29 12:02 出处:网络
I have a textarea where it only allows 150 characters how do I make the focus go 开发者_如何学编程from the textarea to the error message after a user exceeds the maximum number of characters. You must

I have a textarea where it only allows 150 characters how do I make the focus go 开发者_如何学编程from the textarea to the error message after a user exceeds the maximum number of characters.


You must set an identity for the element and then execute document.getElementById('elementId').focus(). If you have troubles with double used id's, then declare a global variable with a sequence number and increase this number (and use it as part of the element id) every time.

0

精彩评论

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

关注公众号