[jQuery] Re: How to replace a div content?

2008-07-07 Thread Hannibal

When you figure this out, let me know.  I'm looking into this as well
and will post anything I find that might work.

On Jul 7, 8:04 am, SimDigital [EMAIL PROTECTED] wrote:
 How could i replace a html content inside the div?

 I have 1 div (div id=elemini text/div) and everytime i click a
 button, i want to replace the html content inside the #ELEM to new
 one.

 I try to use:

 jQuery(#button).click(function() {
         jQuery(#elem).html('bmy text/b');

 });

 but everytime i click the button, the html is not replaced, resulting
 something like:

  bmy text/bbmy text/b

 What is the solution?


[jQuery] Re: How to replace a div content?

2008-07-07 Thread noon

Cut and pasted your example. Works fine for me. Do you not have an
onready opening function, eg $(function() {}?

On Jul 7, 10:04 am, SimDigital [EMAIL PROTECTED] wrote:
 How could i replace a html content inside the div?

 I have 1 div (div id=elemini text/div) and everytime i click a
 button, i want to replace the html content inside the #ELEM to new
 one.

 I try to use:

 jQuery(#button).click(function() {
         jQuery(#elem).html('bmy text/b');

 });

 but everytime i click the button, the html is not replaced, resulting
 something like:

  bmy text/bbmy text/b

 What is the solution?


[jQuery] Re: How to replace a div content?

2008-07-07 Thread Kevin Pepperman
Try setting the div html to empty first.

jQuery(#elem).html().html('bmy text/b');

On Mon, Jul 7, 2008 at 10:04 AM, SimDigital [EMAIL PROTECTED] wrote:


 How could i replace a html content inside the div?

 I have 1 div (div id=elemini text/div) and everytime i click a
 button, i want to replace the html content inside the #ELEM to new
 one.

 I try to use:

 jQuery(#button).click(function() {
jQuery(#elem).html('bmy text/b');
 });

 but everytime i click the button, the html is not replaced, resulting
 something like:

  bmy text/bbmy text/b

 What is the solution?




-- 
Paul Lynde  - I sang in the choir for years, even though my family belonged
to another church.


[jQuery] Re: How to replace a div content?

2008-07-07 Thread donb

Are #button and #elem unique within your html, or have you used either
of them more than one time?


On Jul 7, 5:47 pm, Kevin Pepperman [EMAIL PROTECTED] wrote:
 Try setting the div html to empty first.

 jQuery(#elem).html().html('bmy text/b');





 On Mon, Jul 7, 2008 at 10:04 AM, SimDigital [EMAIL PROTECTED] wrote:

  How could i replace a html content inside the div?

  I have 1 div (div id=elemini text/div) and everytime i click a
  button, i want to replace the html content inside the #ELEM to new
  one.

  I try to use:

  jQuery(#button).click(function() {
         jQuery(#elem).html('bmy text/b');
  });

  but everytime i click the button, the html is not replaced, resulting
  something like:

   bmy text/bbmy text/b

  What is the solution?

 --
 Paul Lynde  - I sang in the choir for years, even though my family belonged
 to another church.- Hide quoted text -

 - Show quoted text -


[jQuery] Re: How to replace a div content?

2008-07-07 Thread Michael Geary

Your code looks fine.

You'll need to post a link to a test page that illustrates the problem,
because otherwise it's anybody's guess what might be wrong.

-Mike

 How could i replace a html content inside the div?
 
 I have 1 div (div id=elemini text/div) and everytime i 
 click a button, i want to replace the html content inside the 
 #ELEM to new one.
 
 I try to use:
 
 jQuery(#button).click(function() {
   jQuery(#elem).html('bmy text/b'); });
 
 but everytime i click the button, the html is not replaced, 
 resulting something like:
 
  bmy text/bbmy text/b
 
 What is the solution?