I have the following:
<div onclick="updateElementWithValue()" id="element">Value 1</div>
<div onclick="updateElementWithValue()" id="element">Value 2</div>
<div onclick="updateElementWithValue()" id="element">Value 3</div>
JS:
updateElementWithValue(){
//need to add some code here to make the function work!
alert('This is element : ');
}
what I want to do, is for example if I click on :
<div onclick="updateElementWithValue()" id="element">Value 2</div>
It displays the value of that div, in the above case, it should show : Value 2
Any ideas?
id="element"