How to compare a string, may be already in variable, with element taken from DOM? with element like this
"Something here"
when i call this element with .text() method, i dont just get "Something here", but more like
"
Something
here
"
This is not a literal example, i mean my value is returned with additional whitespaces, and therefore i'm not able to compare it with anything, even if i copy whitespaced string from console.
EDIT
Pretty much all answers tell me to use $.trim, i tried it before and it doesnt work, doesnt remove all the whitespaces, still cant compare even with copy/paste from console.log