I am keeping having errors from the below code:
<input type="button" id="test" name="test" onclick="test();" value="Test"/>
function test(){
$('#divUser').hide('fast');
$('#divAddress').hide('fast');
$('#divDetails').show();
}
or
$('#test').click(function () {
$('#Div3').show();
$('#Div1').hide('fast');
开发者_Python百科 $('#Div2').hide('fast');
return false;
});
on jsFiddle: http://jsfiddle.net/mohamad/rFhM6/
it is solved: i replaced this:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
with
<script src="/jscripts/jquery-1.2.6.pack.js" type="text/javascript"></script>
Your code seems correct, except that your JavaScript function is not wrapped in a <script>
tag (as pointed by ILMV in your comment):
<input type="button" id="test" name="test" onclick="test();" value="Test"/>
<script type="text/javascript">
function test(){
$('#divUser').hide('fast');
$('#divAddress').hide('fast');
$('#divDetails').show();
}
</script>
精彩评论