javascript - Insert string inside the head tag -


 var c = <head></head><body></body> 

i want insert base tag between head tag. above head tag not in html form inside variable, want modify c variable shown below

<head><base target="_blank"/></head><body></body> 

anyone knows.....

since proposed isn't valid javascript or html, i'm assuming meant have javascript variable c javascript string this:

var c = '<head></head><body></body>'; 

and want change this:

var c = '<head><base target="_blank"/></head><body></body>'; 

if meant, this:

c = c.replace('<head>', '<head><base target="_blank"/>'); 

working demo: http://jsfiddle.net/jfriend00/4p6wf/


if meant different, please clarify editing question.


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -