I have a sentence which I would like to be able to hide words by using Javascript. For example, hiding the first and 6th word or something. Coming from a PHP background my guess is that it would go something like this.
- You have a DIV with a sentence in it.
- You get the value of the DIV (the text sentence).
- You split the text by spaces " " to get each word.
- You then surround each word with a SPAN and id or class.
- You place all the words with the spans around them back into the DIV.
- Then from user interaction (or timeout events) you can hide each SPAN[text]SPAN as needed.
Is this the proper way to handle this?