+ 1
Could you help mi on javaScript
My cod is -> <li id="li">Serhat Merak<button>Cut</button></li> <script> alert(document.getElementById("li").innerHTML) </script> it gives -> Serhat Merak<button>Cut</button> but I want to get-> Serhat Merak how can I get it help me please😊😊😊
5 ответов
+ 12
alert(document.getElementById("li").textContent.replace("Cut", ""));
+ 2
Thank you maz 😊
+ 1
Use innerTEXT instead of innerHTML
0
innerText gives Serhat MerakCut
0
Maz could you look my new question please 😊😊😊