How to use the Oninput attribute?

1

I'm remembering some things in HTML and I came across the Oninput attribute. I know this attribute is for calculations, but I do not know how to use it. I already searched the net, but there is nothing in Portuguese.

    
asked by anonymous 24.11.2016 / 23:08

1 answer

2

OnInput is not an element but an attribute / event that triggers when the user types something inside an element (it can be the <input> element).

Example:

<input type="text" oninput="minhaFuncao()">

The above code runs minhaFuncao() when someone writes something to it.

Another detail is that to create a function to be used in the element, you should study JavaScript or jQuery.

    
24.11.2016 / 23:29