getting the value from button in IE6/7

getting the value from button in IE6/7

Hi again!

Wise people, please help me again :-)

So, i have html code:

  1. <button name="amount" value="1">a</button>

and i want take a value from it a put it in the text input. I tried in two ways:

  1.  $('[name=amount]').click(function() {
  2.       $('input:text').val($(this).val());
  3. });

and this:

  1. $('button[name=amount]').click(function () {
  2.       var text = $(this).attr('value');
  3.       $('input[type=text]').val(text);
  4.  });
and always in Internet Explorer 6 and 7 exept value "1" i got "a". Is there any other way to achive this?!