Hi Rob, Thanks for the quick reply, actually state has a id='state', I can obtain it :
element = document.getElementById("state"); and this element can be either an 'input' or a 'select', is there a way to determine during runtime? Thanks, Angelo On Feb 15, 6:54 pm, RobG <rg...@iinet.net.au> wrote: > On Feb 15, 8:41 pm, "angelochen...@gmail.com" > > <angelochen...@gmail.com> wrote: > > Hi, > > I have this: > > var state = $("sele...@name='state']").get(0).value; > > but there are times there is no select element in the html, and cause > > this statement to fail, > > how to check if there is 'sele...@name='state']' present in the html? > > if (document.getElementsByTagName('select').length) { > // there is at least one select element in the document > } > > -- > Rob