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('<b>my 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="elem">ini 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('<b>my text</b>'); > > }); > > > but everytime i click the button, the html is not replaced, resulting > > something like: > > > <b>my text</b><b>my 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 -