How to set focus on textbox on linkbutton click using javascript
<p>I have this java script function </p>

<pre><code>function showHideSearchPanel(dv) {

var Header = dv == 'Charts' ? 'ChartSearch' : 'ReportSearch';
var div = "ctl00_ContentPlaceHolder1_dv" + Header;
var panel = "ctl00_ContentPlaceHolder1_pnl" + Header;
var hiddenField = "ctl00_ContentPlaceHolder1_hdn" + Header + "Mode";

// I try to add this code in js but it not work
**var serchtextbox = document.getElementById("ctl00_ContentPlaceHolder1_txtSearchName");
if (serchtextbox != null) {
    serchtextbox.focus();
}**
// I try to add this code in js but it not work

if ($("#" + div).attr('display') != 'block') {
    window.status = 'Expanding contents....';
    $("#" + div).slideToggle("slow");
    $("#" + div).attr('visibility', 'visible');
    $("#" + div).attr('display', 'block');
    window.status = 'Done';
}
else {
    window.status = 'Collapsing contents....';
    $("#" + div).hide("slow");
    $("#" + div).attr('visibility', 'hidden');
    $("#" + div).attr('display', 'none');
    window.status = 'Done';
}
$("#" + hiddenField).attr('value', ($("#" + hiddenField).attr('value') == 'On' ? 'Off' : 'On'));
</code></pre>

<p>}</p>

<p>This is my simple menu
<img src="http://i.stack.imgur.com/9HBcE.png" alt="My Search Menu"></p>

<p>When click on search button i want set focu on search textbox which is in below image
<img src="http://i.stack.imgur.com/jS5Ix.png" alt="Click on search table show"></p>
