Strings | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Strings

How to add a string into a paragraph With a function

5th May 2020, 11:22 AM
RED x
RED x - avatar
5 Answers
+ 3
RED x You should ask with proper question. There is so many types to insert String in any tag. 1 :- document.getElementById("tag_id"). innerHTML = "ABC"; 2 :- $("#tag_id").html("ABC"); 3 :- $("#tag_id").text("ABC"): 4 :- $(".className").html("ABC");
5th May 2020, 12:23 PM
A͢J
A͢J - avatar
+ 2
Use: document.getElementById('myid').innerHTML = "my added string";
5th May 2020, 11:37 AM
Agent
Agent - avatar
+ 1
<p>ABC</p> just like this
5th May 2020, 11:25 AM
A͢J
A͢J - avatar
0
I mean with a function
5th May 2020, 11:26 AM
RED x
RED x - avatar
0
Thank you all
5th May 2020, 4:41 PM
RED x
RED x - avatar