javascript - Newbie: how to hide and show in my case using jQuery? -
i newbie in jquery. have index.html page,
<body> <div id="content"> </body>
i feature when page loaded, "content" area shows list:
<div id="my-list"> <select id="carlist" size="10"> <option>bmw</option> <option>toyota</option> <option>skoda</option> </select> </div>
when user select car list option, list "my-list
" disappear(hide), , image shown in "content
" area.
that's hide selection filed , show image in same "content
" area.
how in jquery??
i tried:
var mylist=$('#my-list'); mylist.change(function(){ mylist.hide() someimage.show() }
but, define "my-list
" , image
in same "content
" area? how implement all?
var mylist=$('#carlist'); mylist.change(function(){ mylist.hide(); var container = mylist.parent(); container.find('img').remove(); container.append('<img src="x.jpg" />'); }
Comments
Post a Comment