javascript - JQuery append() adding quotes and newlines and I don't know why -


i have append statement adds single character @ time span. (the characters pulled string treating array: text[i] , such.) feel should giving me this:

<span id="outputid0">text</span> 

but instead it's giving me this:

<span id="outputid0">   "t"   "e"   "x"   "t" </span> 

i guess makes sense, , not real problem @ moment, bit awkward-looking , i'm not sure why it's happening. can explain 1 me?

edit: here's link jsfiddle, showing example of talking about. thank ᾠῗᵲᄐᶌ, seems have diagnosed , solved problem fine without that. if else see it, there is.

append adds child node after last child node each character going text node , why separated

if want add character @ time you're better off taking whats there , concatenating char string that's there

you can using jquery's .text(function(){}) function

// = index , v = current text value $('#outputid0').text(function(i,v){      return v + "your new char"; }); 

fiddle example


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -