I am a begginer in JavaScript and I have this problem: HTML code:
<textarea class="text_input" cols="40" rows="1" onclick="init_area();"></textarea>
<textarea class="text_input" cols="40" rows="1" onclick="init_area();"></textarea>
I want that when a user clicks on this textarea element to remove cols attribute for example. But only for the element that is clicked. I dont know how to do that. Can you help, please?
thisin an eventhandler function refers to the element which an event has been attahed to.onclickattribute is handled a little differently. I think he'd have to do:onclick="init_area(this);". I haven't usedonclickattributes in forever since they are bad practice.