You need to escape the pipe since it is a special character. Use \\| instead of | inside the selector. For more info, see:
http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_that_has_weird_characters_in_its_ID.3F - Richard On 10/3/07, ab <[EMAIL PROTECTED]> wrote: > > > I am trying to select an element with with ID which have pipe > character (|).... > i found that its not working > > > CODE--HTML > <input type ="text" id="firstName|1" name="firstName|1"/> > > CODE-SCRIPT > alert($("#firstname|1").val() ); > > and output is "undefined".............................. > > Works well if i remove pipe > > Please help me..is it a bug or "feature" > >