I am having trouble getting the word number of a word a user has selected
For example
I have a simple paragraph which contains two words Hi and bob
<p>Hi bob</p>
So logically Hi=1 and bob=2. Now lets assume the user has selected bob I want the Program to log the number 2 to the console now lets assume the user has selected Hi it should log the number 1 to the console. Also this program should work for any amount of words.
Any help would much appreciated
Thanks