I'm trying to change the HTML content from a div
based on a click function. The problem is that my script prints the name instead of HTML content any ideas?
This is what I have so far:
var fragment_1 = $ ('# fragment_1'). Html (); Var fragment_2 = $ ('# fragment_2') Html (); Var fragment_3 = $ ('# fragment_3'). Html (); Var counter = 1; $ ("#memory") html (fragment_1) Click on $ ("#Videre") (stageChange). Change the function step () {counter ++; $ ("#team"). Html ('fragment_' + counter); };
Try it with:
var i , Count = 3, prefix = 'fragment_', fragmentMap = {}, counter = 1; For (i = count; i> I;) {frametamap [i] = $ ('#' + prefix + i). Html (); } $ ("#team"). Html (piece map [counter]); Click on $ ("#Videre") (stageChange). Change the function step () {$ ("#team"). Html (piece map [++ counter]); };
Comments
Post a Comment