Reputation: 2155
I am working on one application, i am facing one problem on Internet Explorer while retrieving inner HTML of div.
I have below input for retrieving :
<div> This is first segment</div>
I have used jquery script to extract content. i.e.
$('div').html();
Output after using above statement :
This is first segment
Here not retrieving leading space present in div.
I am expecting here is :
This is first segment
I am facing this problem on Internet Explorer, It's working properly on FireFox.
Please suggest your thoughts on this.
Thanks in advance
Upvotes: 2
Views: 112
Reputation: 9440
I think there is nothing to do about this. Maybe you can do it the safe way:
<div> This is first segment </div>
or try jQuery text()
Or try the non jQuery functions innerHTML
innerText
Upvotes: 1
Reputation: 936
You put
before the text to force a non breakable space. This is recognised by all browsers.
Upvotes: 0