The html() method will just set the HTML contents of each element. So based on the partial code you provided, this "<img src="..."/>" will be replaced by the text in your Onchange() function.
If you are trying to show/hide an image, in this scenrio, you would have to take the image out of the contents of the Div and use other methods such as show(), hide().
without knowing the full picture, its hard for me to provide a best overall approach.
JorgeM
Senior Poster
3,997 posts since Dec 2011
Reputation Points: 294
Solved Threads: 543
Skill Endorsements: 115
To test whether an user has already logged in, you'd be safer using server-side code to hold a session variable. All js code can be circumvented, so using it to handle this sort of thing may not be appropriate. Ajax is being used more and more to deal with login.
As Jorge states, you need to pass data that will change the image. Using the src attribute of an image is probably the easiest:
$('#someimageid').attr('src','path/file.png');
Is this form meant to accept registration data and login data depending on the content of the div? E.g.
<div><label onclick=Onchange(1)><img id="someimageid" src="img/login.png" /></label></div>
diafol
Keep Smiling
10,625 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,506
Skill Endorsements: 57