I've written a Simple function in Javascript which calls a jQuery function the problem is Why do I need to click button to get the toggle effect
html
<input id="toggle" type="button" value="Toggle" onclick="toggle()" />
javascript
<script type="text/javascript">
function toggle()
{
new_toggle();
}
</script>
jQuery
$(function new_toggle2(){
$('#toggle').click(function(){
$('#p1').toggle(); // Simple <p> and <h1> tags
$('#h').toggle();
});
new_toggle = new_toggle2;
});