문제

In jQuery you can force focus onto an input using something along the lines:

$("input[name='text']").focus();

But how is it done in ClojureScript (preferable something Enfocus friendly) ?

도움이 되었습니까?

해결책 2

I must have been very tired, the following works :)

(ef/at "input[name='text']" (focus))

다른 팁

Without using enfocus, you can do this by calling javascript functions, e.g.

(-> js/document (.querySelector "input[name='text']") (.focus))

or using .. threading:

(.. js/document (querySelector "input[name='text']") (focus))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top