I want to know the name of the select when you select a option, for example:
If I select the 2 option in the select1 I need to catch the name of the select(in this case select1) via js or jquery, that's why I'm using "this" as a parameter in the onchange, the problem is that I dont know how to get the name of the select with this "this", I tried this.name but it does not work.
Any ideas?
Thx
<select onchange="jsFunction(this);" name="select1">
                <option selected>1</option>
                <option>2</option>
              </select>
<select onchange="jsFunction(this);" name="select2">
                <option selected>1</option>
                <option>2</option>
              </select>
EDIT:
The function has literally nothing:
jsFuntion(element){
alert(element.name);
}
 
     
     
     
    