zeldaze
05-07-2008, 10:39 AM
Hi guys,
I just need to see if I have this right. I am fairly new to Javascript etc. and I don't know it's syntax but this is what I need done. I have a function that checks if and element in my HTML coding has a certain ID and if it does it applies effects to it.
For example:
function('note1');
So if I have something say <span id="note1">, then this function checks if the ID = note1 and then does its stuff. However I have more than one of these so if I have <span id="note2"> etc. in one page then only the variables that are entered will be effected.
I could write a long list inside the function consisting of "note1", "note2" etc all the way up to 999, but instead I would like to know the syntax for making something like this
function('note*');
So it will be any id beginning with note regardless of the number that is after it. I have tried the above but it doesn't work. I am not sure what this feature is called but I just need a headsup.
Thanks :)
I just need to see if I have this right. I am fairly new to Javascript etc. and I don't know it's syntax but this is what I need done. I have a function that checks if and element in my HTML coding has a certain ID and if it does it applies effects to it.
For example:
function('note1');
So if I have something say <span id="note1">, then this function checks if the ID = note1 and then does its stuff. However I have more than one of these so if I have <span id="note2"> etc. in one page then only the variables that are entered will be effected.
I could write a long list inside the function consisting of "note1", "note2" etc all the way up to 999, but instead I would like to know the syntax for making something like this
function('note*');
So it will be any id beginning with note regardless of the number that is after it. I have tried the above but it doesn't work. I am not sure what this feature is called but I just need a headsup.
Thanks :)