Register now or log in to join your professional community.
I have textbox <input name="title_bar" type="text" /> any text on this text-box should be appear to URL title bar of the browser I wanna something may worked on IE7
Solved,
$(document).ready(function()
{
$('#textBox').bind('keypress blur', function()
{
$(document).attr('title',$('#textBox').val());
});
});
Enjoy Jquery :)
The solution was using
history.pushState(null, null, $("[name=title_bar]").val());
But the problem was : this solution not worked in IEs browser .I need more general solution. Can I get help?
$("title").text("New Title");
$(function(){
var YOUR_PATH = "/foo.html";
$("#txtBox").change(function(){
document.title = this.value;
try {
history.pushState(null, "", YOUR_PATH);
}catch (e){
window.location.hash = YOUR_PATH;
}
});
});
$(document).ready(function(){
$('#tbID').keyUp(function(){
if($('#tbID').val()!='')
{
$(document).attr('title',$('#tbID').val());
}
})
})
Give your Input an ID, let's say ("txtTitle")....
u do the following....
var The_Title=$("#txtTitle").val();
$("title").text(The_Title);
give the id to text box like,
<input id ="title_bar" name="title_bar" type="text" />
In jquery,
textValue = $( "#title_bar" ).val();
document.title = textValue;
Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.