How to make the p tag changable when clicked? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

How to make the p tag changable when clicked?

https://code.sololearn.com/WtPAUoBWL2d6/?ref=app

12th Jun 2018, 12:08 PM
B.D
B.D - avatar
8 Answers
+ 4
try:: <p contenteditable="true"></p>
12th Jun 2018, 12:24 PM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar
+ 1
you question is unclear.. you want to change the innercontent? you want to change the tag itself?
12th Jun 2018, 12:11 PM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar
+ 1
I want to change the content
12th Jun 2018, 12:12 PM
B.D
B.D - avatar
+ 1
Wait, do you want the element to act as an input or just change it's contents to something else.
12th Jun 2018, 12:21 PM
BlazingMagpie
BlazingMagpie - avatar
+ 1
I want it to act as an input
12th Jun 2018, 12:23 PM
B.D
B.D - avatar
+ 1
thank you
12th Jun 2018, 12:27 PM
B.D
B.D - avatar
0
why not just use <input type="text"/>
12th Jun 2018, 12:14 PM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar
0
$('p').text(val)
12th Jun 2018, 1:04 PM
KrOW
KrOW - avatar