Using jquery to change a div id -


i have html page with:

<div id="box-"></div> 

how use jquery change (is append right word?) box- box-2353 2353, or whatever number, set in separate .txt file?

i've found solutions changing class, don't have option since it's coming rss feed , set id.

try (plain javascript):

document.getelementbyid('box-').id += getthenumber() 

or jquery:

var $box = $('#box-') $box.attr('id', $box.attr('id') + getthenumber()) 

fiddle


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -