Search
 
SCRIPT & CODE EXAMPLE
 

HTML

html use js variable as text


<h1>"My number: " <span id="myText"></span></h1>

<script>

	//You can use an IIFE (Immediately Invoked Function Expression)
	(() => {
  		var number = "123";
		document.getElementById("myText").innerHTML = number;
	})();
</script>
Comment

PREVIOUS NEXT
Code Example
Html :: bootstrap 3 button 
Html :: bulma upload file 
Html :: bootstrap disabled button 
Html :: html dns prefetch 
Html :: how to make a link in html 
Html :: a tag open in new tab 
Html :: ionic deactivate fab button 
Html :: getproductpricehtml magento 2 
Html :: how to make a scrollable list in html 
Html :: access key attribute 
Html :: use python code in html 
Html :: predefine data list in input tag 
Html :: html basico 
Html :: html center tag 
Html :: add manifist to html 
Html :: thymeleaf import in html 
Html :: order invoice template in html 
Html :: svg xmlns 
Html :: regular expression to look for html tags 
Html :: js html input type image base64 example 
Html :: Html.ActionLink with parameters 
Html :: add a html form 
Html :: html simbols 
Html :: comment in html5 
Html :: modal footer align left bootstrap 
Html :: how to hide error in laravel 
Html :: tailwind css float right 
Html :: html add vertical space below 
Html :: add a alt to a image in html 
Html :: get image from google drive 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =