Stuyvenstein
Stuyvenstein

Reputation: 2447

Javascript not writing forward slash

I have the following: http://jsfiddle.net/mVs9T/13/

Could someone please tell me why the output is printing

<br>

instead of:

<br/>

like here: http://f.imgtmp.com/Xjoq3.png

Upvotes: 4

Views: 511

Answers (4)

Rob Sedgwick
Rob Sedgwick

Reputation: 5226

We added alert(txt); and it gave us <br/> - looks good to go.

Upvotes: 1

Daedalus
Daedalus

Reputation: 7722

Yes, because that is how chrome interprets the <br /> tag. It's just aesthetic; you need not worry about it.

Upvotes: 3

madeFromCode
madeFromCode

Reputation: 721

Since nothing can go between a <br> tag the /> part is not necessary. This is probably why the browser doesn't display it.

Upvotes: 0

Siva Charan
Siva Charan

Reputation: 18064

That's browser behaviour. It shouldn't be a problem.

Upvotes: 0

Related Questions