javascript - This code cant find the div with a specific id -


If you try this code here:

I try Find out if I do not know if I find a divas with ID "Test" and I can make it. The problem is that if I call this function multiple times, it makes div all the time:

  var divClasses = $ ('# test'); If (divClasses.length == 0) {divClasses = $ ('& lt; div / & gt;', {id: "test"}). Annex ('body'); Console.log ('unusual!'); }  

How does it come?

Your keyboard must produce different characters than expected, either your '< / Code> or # is incorrect.

You can see the difference between your '#test'

  encoduriconant ('# test') ->  

and a #test is typed into an English keyboard

  encodeurIComponent ('% E2% 80% AA% 23 test '#test') - & gt; "% 23 test"  

I think this is the starting bid, maybe.

Enter image details here


Comments

Popular posts from this blog

Removing From ArrayList, In Loop Based On It's Size, But Breaking After Remove Still Gives OutOfBounds -

c# - Reactive Extensions ControlScheduler -

java - Add color code support to a Bukkit plugin -