Generating random number for input value

Generating random number for input value

Hello,

I have a numbers only text field and want to assign a random number as it's value.

This is the HTML for the field:
  1. <div class="productAttributeRow productAttributeConfigurableEntryNumbersOnlyText">
        <div class="productAttributeLabel">
            <label>
                <span class="name">
                    Hidden:   
                </span>
            </label>
        </div>
        <div class="productAttributeValue">
            <input type="text" class="Field validation" value="" size="5"  />
        </div>
        <div class="cf"></div>
    </div>













My non-working script:

  1. var randomnumber=Math.floor(Math.random()*11)
        
    $('.productAttributeConfigurableEntryNumbersOnlyText.productAttributeValue input[type="text"]').value(randomnumber);    





ID's or names cannot be used here....sorry, another weird situation.

As always, help is very much appreciated.

Thank you,
Susan