javascript - attr. ID only works once, despite different IDs -


this site: http://marmiteontoast.co.uk/fyp/login-register/register-username-builder.php

when drag tile right , drop in coloured box, adds id droppable (try , see).

this works fine number 1. tile , box, rest of them... nothing. no id added.

this code adding of id "droppedone" works fine:

$( ".slot.one" ).droppable({   drop: function(event, ui) {     ui.draggable.attr('id', 'droppedone');     $(".save.one").fadein("fast");   } }); 

id's unique html elements

ui.draggable.attr('id', 'droppedone'); 

will need use class instead, changing to:

ui.draggable.addclass("dropped"); 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -