Reputation: 359
I'm new to js and game development but i want to learn... For learning i'm creating some multyplayer game - make the bigger word.
so I have a letters that users stop on stop div and then trying to create a bigger letter than other.
Here is the whole code: http://jsfiddle.net/9rtFa/4/
What I need is when letters stop , when user stop it and when user click on some div with letters that letter to write into div "F" . and when click on button "x" to clear the last letter into div "f" ...How I can do that?
Upvotes: 0
Views: 225
Reputation: 144659
try this:
$(".letter").click(function(){
$("#F").text($("#F").text() + $(this).text())
if( $("#F").text().length > 0) $(".letter").unbind("click");
})
$('#b').click(function(){
$("#F").text($("#F").text().slice(0, -1))
})
Upvotes: 1