set a value to textbox

set a value to textbox

I'm trying to set value of texbox with name "Pay" to 0.

But it doesn't work. What is wrong?

  1. $(document).ready(function(){

    $("button").click(function () {

    $("input:text[name=Pay]").val(0);

    });

    });