<div>
<input id="txt" type="text" placeholder="Choose File" />
<input type="file" id="selectedFile" class="hidden" onchange="ChangeText(this, 'txt');" />
<span>
<button type="button" onclick="document.getElementById('selectedFile').click();">Browse</button>
</span>
</div>
我只想在角度js中的點擊事件。誰能告訴?GetElementById等效於角js
我只想在角度js中的點擊事件。 任何人都可以告訴? 代碼在評論
請更清楚地描述問題。如果你想在angular角度點擊事件,那麼需要使用ngclick事件 –
我的代碼是在js中,在瀏覽按鈕中,我給了onclick事件,以便它將像這樣獲取selectedfile id元素, 所以我想要角度js中的那個函數 –