well it means : if(x=='hi') { id='#list' }else{ id='#list1' }
simple conditional operator or say ternary operator ?: With Regards, Chandan Luthra Mb:+91-9311792622 Intelligrape Software Pvt. Ltd. On Tue, Jan 6, 2009 at 12:57 PM, Vijendra <vijendrami...@gmail.com> wrote: > > Thanks mike... its working now... :) :) but i am unable to understand > this line of code > > var id = x == 'hi' ? '#list' : '#list1'; > > can u explane me??? > > > > On Jan 5, 6:45 pm, Mike Alsup <mal...@gmail.com> wrote: > > > ya i know mike ... but i have to hide another list when you select > > > next like if you select "hi" it has to display list related to "hi" > > > and when we select "Hello" it has to display list related to "Hello" > > > and hide list related to "hi" ... but it not doing... if i put hide > > > code in if() then it simply shows me both list without selecting any > > > option... got my problem?? > > > > $(document).ready(function() { > > $('#list,#list1').hide(); > > $('select.alert').change(function() { > > $('#list,#list1').hide(); > > var x=($(this).val()); > > var id = x == 'hi' ? '#list' : '#list1'; > > $(id).show("slow"); > > }); > > > > > > > > });- Hide quoted text - > > > > - Show quoted text -