1 Replies - 2094 Views - Last Post: 07 November 2011 - 11:56 AM

#1 Akabelle  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 10-February 11

How to create an Array of divs?

Posted 07 November 2011 - 11:35 AM

I've been wondering lately: is it possible to create an array of some html tags (let's say array of <div> or array of <p>)? Something which would allow me adding a new <div> or <p> to the array.

I am to make a small html webpage in which there are supposed to be 2 text areas: in the first are certain words (for example tomorrow, money etc.), and in the second one there is an input text (let's say "Tomorrow you must send me the money I need"). Javascript should do this: print the input text in a paragraph/div, highlighting the words mentioned above. Something like: Tomorrow you must send me the money I need. This is how I thought of the array of tags, which can at any time add a new word to the output paragraph, it's only to be chosen whether to highlight it or not.

Is there a way to use array of tags? Or is there some other solution how to solve this task?

Is This A Good Question/Topic? 0
  • +

Replies To: How to create an Array of divs?

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,238
  • Joined: 08-June 10

Re: How to create an Array of divs?

Posted 07 November 2011 - 11:56 AM

I would just do a string replace of the text on the mentioned words.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1