Reputation: 43
I need to remove on click input type attribute. Example:
<input type="number" (click)="removeInputModeAtribute()" inputmode="none">
removeInputModeAtribute(){
//remove inputmode="none"
}
Upvotes: 0
Views: 1845
Reputation: 4808
as @AlphaMirage said you can use removeAttribute
function
if you want to remove inputmode
just pass the element into your function and use removeAttribute
like:
in your .ts
file
removeEl(el:HTMLInputElement) {
el.removeAttribute('inputmode');
}
and in your .html
<input type="number" #el (click)="removeEl(el)" inputmode="none">
Upvotes: 1
Reputation:
I don't know angular but you can do this with plain javascript:
function remove(what) {
alert('You Will Only See This On The First Click!')
what.removeAttribute("onclick");
}
<button onclick='remove(this)'>BUTTON</button>
Turns out this is not the answer!
Upvotes: 0