The moose likes HTML, CSS and JavaScript and the fly likes Jquery clone().text() doesn't work in IE Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Jquery clone().text() doesn Watch "Jquery clone().text() doesn New topic
Author

Jquery clone().text() doesn't work in IE

Colin Zheng
Greenhorn

Joined: Oct 25, 2011
Posts: 14
Hi,
Can you help me understand why this doesn't work in IE but works in FF?




Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50691

It's not a discrete element. You've got that <br> in there that's likely boofing things up. What happens if you remove the <br>?

(<br>? Why aren't you using CSS to control layout?)


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50691

I also rarely use .text(). I find that .html() seems to work more reliably.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
I think I am with Bear on the BR messing it up.

Try



Eric
Colin Zheng
Greenhorn

Joined: Oct 25, 2011
Posts: 14
Yeah, you guys are right: the <br> messed it up. When I removed it, it works in IE now. Thanks for the quick point-out.
I am very frustrated on debugging Javascript in IE as a beginner. Do you have good idea on any tools that we can debug like Firebug in Firefox?

Thanks a lot,
Colin
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50691

Modern versions of IE have a built-in debugger.
 
IntelliJ Java IDE
 
subject: Jquery clone().text() doesn't work in IE
 
Threads others viewed
selecting pure text in jquery
CSS Positioning Issue
tool tip over a text
unable to connected to next page
problem with html:errors
developer file tools