How to use javascript to call other javascript like this code?

How to use javascript to call other javascript like this code ?

.....................................................................................................................................................................

http://jsfiddle.net/peap/bjdq3oL3/1/

<script src="http://code.jquery.com/jquery-1.7.2.js"></script>
<form method="post" id="form_content" action="Javascript:void(0);">
    <button id="desc" name="desc" value="desc" style="display:none;">desc</button>
    <button id="asc" name="asc"  value="asc">asc</button>   
</form>

<script>
$(document).ready(function(){
    $('#form_content button').click(function(){
        $('#form_content button').toggle();
        var numbers = this.id;
        function_two();
    });
});

function_two(){
      alert('numbers');
}
</script>

Upvotes: 0

Views: 41

Answers (1)

Spokey
Spokey

Reputation: 10994

function_two(){
    alert('numbers');
}

Needs to be declared as a function

function function_two(){
    alert('numbers');
}

http://jsfiddle.net/bjdq3oL3/2/

Upvotes: 3

Related Questions