Send value with jquery

Viewed 1901

How can I send a value with jQuery? I have tried this:

<span onclick="doSomething()" value="3">Select this Shop</span>
<input class="my-shop" value="">
<script>

function doSomething(){

  var text = $( this ).val();

  $( ".my-shop" ).val( text );
}
</script>

My code does not work, and I don't know why.

3 Answers
Related