I want to activate a Google Custom Search when an input button is clicked. The button that is clicked only gets me to the appropriate <tr> that contains a <td class="PlayerName">. I want to use that player name as a search term. Consider the following code;
$(document).ready(function() {
var newcolorvalue = 0;
var $selectedBench = null;
var GoogleCSEquerystring = '';
$(" .BenchPosButton").live("click", function(){
$selectedBench = $(this);
newcolorvalue = colorscale(d2h(Math.floor(Math.random()*16777215)));
$(this).parents("tr").css("background-color","red");
GoogleCSEquerystring = $(). <--------------- this is where I need to select the string with the players name
});
<tr class="bench">
<td class="pos"><input type="hidden" name="id#rc.qLineup.currentrow#" id="id#rc.qLineup.currentrow#" value="#rc.qLineup.qs_id#">
<input class="BenchPosButton" type="button" value="#rc.qLineup.pos#" name="posbutton#rc.qLineup.currentrow#" id="posbutton#rc.qLineup.currentrow#"/></td>
<td class="PlayerName">#rc.qLineup.name#
<input class="GameTime" name="gametime#rc.qLineup.currentrow#" id="gametime#rc.qLineup.currentrow#" type="hidden" value="#rc.qLineup.gametime#">
</td>
<cfif rc.qLineup.gametime gt "">
<td>#rc.qLineup.gametime#</td>
<cfelse>
<td style"background-color:grey;">On Bye</td>
</cfif>
</tr>
<div id="cse" style="width: 100%;">Loading</div>
<script src="//www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1', {language : 'en', style : google.loader.themes.GREENSKY});
google.setOnLoadCallback(function() {
var customSearchControl = new google.search.CustomSearchControl('003532023923749387211:ee91vigcs4');
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
customSearchControl.execute(GoogleCSEquerystring); <------- search string
customSearchControl.draw('cse');
}, true);
</script>