[jQuery] trying in a function to change css color on divs
Hi,
I'm trying to change color on a div from the change of an input field.
what i need is to get the name of the input field that is the same as
the div name ( and the value, to be able to do the change).
to avoid repeating i'm trying to create one function that can handle
all.
the html part:
<input type="text" id="body_bgcolor" name="body_bgcolor"
class="update" value="<?echo $body_bgcolor1 ?>" class="texte"
style="width:50px;" />
<input type="text" id="header_bgcolor" name="header_bgcolor"
class="update" value="<?echo $header_bgcolor1 ?>" class="texte"
style="width:50px;" />
$(input[@name=this)].change(function(){
$(#inputthedivid).css('background-color',' set the new color');
});
If someone has any ideas on how to do this.
Thanks
Rag