Hi there, I am new to jquery and trying to write one jquery function to do multiple things and either what I am trying to do isnt supported or I am doing it wrong, a little help would be awesome.
Here is my function as is and working.
Called by: $("#drop_player").click(onSelectRoster);
function onSelectRoster(){
var selected = $("#roster option:selected");
var output = "";
if(selected.val() != 0){
output = selected.text();
}
$("#rfa_drop").val(output);
}
What I am trying to do is change the output textbox based on a passed variable like this.
Called by: $("#drop_player").click(onSelectRoster("#rfa_drop"));
function onSelectRoster(test){
var selected = $("#roster option:selected");
var output = "";
if(selected.val() != 0){
output = selected.text();
}
$(test).val(output);
}
Can someone point me in the right direction.
Thanks!
Here is my function as is and working.
Called by: $("#drop_player").click(onSelectRoster);
function onSelectRoster(){
var selected = $("#roster option:selected");
var output = "";
if(selected.val() != 0){
output = selected.text();
}
$("#rfa_drop").val(output);
}
What I am trying to do is change the output textbox based on a passed variable like this.
Called by: $("#drop_player").click(onSelectRoster("#rfa_drop"));
function onSelectRoster(test){
var selected = $("#roster option:selected");
var output = "";
if(selected.val() != 0){
output = selected.text();
}
$(test).val(output);
}
Can someone point me in the right direction.
Thanks!