O.P. Javascript Help [SOLVED!]
Hey guys, im having trouble with javascript coding. I know for a fact that this comunity has a lot of genus coders which is why im asking here first.
Anyways, what i wanna acomplish is:
I've got a div tag with a content "hello world"
ie: <div>hello world</div>
Now what I wanna do is take out anything after 4 letters in that div tag
ie: so im left with the word 'hell' in the end. instead of 'hello world'
I know i can use:
x=x.substr(0,4);
to subtract anything after the 4rth letter but my question is... how do I apply this logic to what I wanna get acomplished?
could someone who knows what they're doing please complete the code for me so i can understand how its done right? Thanks everyone!
I've got a joost + pownce invite for the first person with the working script
This post was edited on 08-18-2007 at 10:00 AM by glennlopez.
|