[wd_asp elements=’search’ ratio=’100%’ id=1]

String changes/transfer to textboxes

17th July 2013

Jquery - Strings

jquery icon

$(".timemachine").click(function() {
var timemachinetype = ($(this).attr("name")); //get name of clicked class element
$('.answerarea').val('Cool.. you got a '+timemachinetype+'!') // make value of textbox with class answerarea equal 'Cool ect'
$('#q6hidden').val(timemachinetype); //transfer a javascript variable to textbox
$('#userCaption').val(''); //transfer a php variable to a textbox
$("#sixty").trigger("click"); //pretend that you have clicked element id 'sixty' (make sure its a button etc)
$('.q6').hide("fast"); //hide div with class q6
$('.q7').slideDown("2000", "easeOutBounce"); //show div with class q7 (must call jquery ui)
});