Good evening everybody!
Well, I am studying JavaScript at the moment, and I reachead the point in where I need, based on clicked text (button, ... it doesn't matter, I guess).
For example:
This message should be edited.
Two choices: ES - EN
If choice "ES" is clicked/selected, then:
This message has been edited to ES.
Otherwise, if choice "EN" is clicked/selected, then:
This message has been edited to EN.
I think this could have been achieved with an if in a script, but the problem is how to tell the script which option has been chosen, if "ES" or "EN".
I have this:
<p id="demo">This message should be edited.<p>
<a href="#" id="ES" onclick="func();">ES</a> - <a href="#" id="EN" onclick="func();">EN</a> - <a href="#" id="JP" onclick="func();">JP</a>
And as I said, the problem is that I don't know how to tell the script what has been clicked/selected.
Thank you for any help you may give me (if possible, an explanation with or over a solution would be amazing because I want to learn and understand, not to solve this problem without being able to solve the same thing or similar in a future).