i used this line of code but it didn't work
$("a#link").attr("href",$(this).attr('tempref').val());
i used this line of code but it didn't work
$("a#link").attr("href",$(this).attr('tempref').val());
When you call:
$(this).attr('tempref')
that returns a value that is not the jquery object so you can not add .val() after that and you cannot refer to the object with this. If you want to assign the value to the href attribute you must do:
$("a#link").each(function(){
$(this).attr("href",$(this).val());
})
If you don't want to do this, try to explain better your question.
You don't need to call val():
$("a#link").attr("href", $(this).attr('tempref'));
thanks all i used this code and it works fine
$("a").each(function(){
if($(this).attr('tempref')!=null)
{ var tempref= $(this).attr('tempref');}
if(tempref!=null)
{ $(this).attr('href',tempref); }
})