Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

change h2 to h1 using javascript

/*Try using this function*/
function changeHTMLTag(elemSelector,tagType)
{
	var elem = document.querySelector(elemSelector);
    elem.outerHTML = '<' + tagType + '>' + elem.innerHTML + '</'+ tagType +'>';
}
// eg usage: change #myElem to use h2 tag -->
changeHTMLTag('#myElem', 'h2');
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript Modules Always use Strict Mode 
Javascript :: how to use port variable in axios 
Javascript :: ucwords javascript 
Javascript :: javascript regular expression methods 
Javascript :: recorrer array javascript 
Javascript :: Regex Match Only Number Lines 
Javascript :: declaring variable react hooks 
Javascript :: javascript make pong 
Javascript :: react native run android common error 
Javascript :: canvas container page offset 
Javascript :: negative indexing in arrays javascript 
Python :: epa meaning 
Python :: import beautifulsoup 
Python :: drop the last row of a dataframe 
Python :: plt figsize 
Python :: pygame scale image python 
Python :: pygame get screen width and height 
Python :: django admin no such table user 
Python :: remove all pycache files 
Python :: how to install pyaudio 
Python :: python read json 
Python :: sqlalchemy query bilter by current month 
Python :: seaborn size 
Python :: url decode python 
Python :: pandas calculate iqr 
Python :: copy whole directory python 
Python :: yyyy-mm-dd hh:mm:ss.0 python 
Python :: import mean squared log error 
Python :: select categorical columns pandas 
Python :: clear terminal in python 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =