Jump to content
php.lv forumi
  • 0

jquery pec append iztirit...


goma smile

Question

5 answers to this question

Recommended Posts

  • 0

Mana problēma

 

$('#fafa').append('<li>kkas</li>');

 

un ja es gribu iztīrīt šo #fafa un likt jaunu $('#fafa').append('<li>kkas CITS</li>'); šis iepriekšējais kkas nepazūd.. vismaz ar $('#fafa').html(''), nepazūd es pieņemu ka ir kaut kāda 'live' funkcija kas spētu izlabot manu problēmu...

Link to comment
Share on other sites

  • 0

Ko tu īsti gribi, vari normāli paskaidrot?

Ja nomainīt $("#container") saturu, tad vienkārši $("#container").html("<p>Jaunais saturs</p>");

Ja iztīrīt $("#container") saturu, tad $("#container").empty();

Ja izdzēst $("#container"), tad $("#container").remove();

Bet, kāpēc tu mums stāsti par .append(), es tā arī nesapratu. .append() un .prepend() papildina esošo saturu un neko nedzēš - tam tā arī jābūt.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...