sorry i'm new in jquery and i need help :-( i want to traverse all elements on html page with class parts then go inside to two children and pass them a random number ( the same for them both)
for every element new random number is passed ( no repeat on page) children classes are : anot-head anot-body this is a sample code:
$(document).ready(function() {
$.each($('.parts'), function(){
var ran=Math.floor(Math.random()* 1000000);
$( ".anot-head" ).attr( "data-toggle","collapse" ).attr( "href","#s"+ran );
$( ".anot-body" ).attr( "id","s"+ran );
});
});