是否有可能将ID绑定到离子textarea?离子3绑定ID <离子textarea>
像:
<ion-textarea placeholder="Enter your thoughts" id="thoughtsBox"></ion-textarea>
非常感谢
是否有可能将ID绑定到离子textarea?离子3绑定ID <离子textarea>
像:
<ion-textarea placeholder="Enter your thoughts" id="thoughtsBox"></ion-textarea>
非常感谢
当然,你可以做吧。你用它的方式是正确的。
我试过这个,我的应用程序在函数调用时崩溃了:'document.getElementById('thoughtsBox')。focus();''''''''' Logcat出错:'chromium:[INFO:CONSOLE(56113)]“[WARN] TypeError:无法读取null的属性'focus',source:file:///android_asset/www/build/main.js(56113) ' – MrFlyingToasterman
我已经使用这个: - 尝试使用这款本作可能会以及工作: - 的setTimeout(()=> { 的document.getElementById( '广播文本域')专注(); 键盘。显示(); },750) –
@MrFlyingToasterman尝试使用它,让我知道如果它不起作用 –
您是否试图将焦点设置为具有该ID的元素? – sebaferreras
是的,像这样'document.getElementById('thoughtsBox')。focus();' – MrFlyingToasterman