add $(id) function
append div at the beginning
modify script structure