Login | Register | FAQ
Anonymous

Modifying HTML Elements.

+ Post a reply

Page 1 of 1


Modifying HTML Elements.

by tamas » Sat Jun 30, 2012 10:59 pm

I know you can create elements with .createElement/.appendChild, and that you can delete them with .removeChild, but if I wanted to edit a text node what would it look like? Would I have to delete the old node and make a new one?
User avatar

tamas

  • Posts: 2
  • Joined: Thu Jun 28, 2012 4:27 am

Re: Modifying HTML Elements.

by soccerwebsitemaker » Sun Jul 01, 2012 3:58 pm

I suppose so, just delete paragraph and add text input with JQuery animations, maybe...
User avatar

soccerwebsitemaker

  • Posts: 139
  • Joined: Sat Dec 31, 2011 6:25 pm
--
Coins. Profile. Games. Chat. Fun.

CoinAwards.

Check it out at http://www.coinawards.net63.net/

Re: Modifying HTML Elements.

by XainPro » Mon Jul 02, 2012 6:05 am

no you just need to replace inner html of the element :)
i.e
$("div").html("<span class='red'>Hello <b>Again</b></span>");
User avatar

XainPro

  • Posts: 3327
  • Joined: Fri Feb 17, 2012 8:10 pm


+ Post a reply

Page 1 of 1