add id to dynamically created

后端 未结 6 2144
鱼传尺愫
鱼传尺愫 2020-12-23 18:48

I have the following JavaScript that creates a div and then appends it to the body and then inserts some dynamically generated HTML into it. cartDiv = document.createElement

6条回答
  •  伪装坚强ぢ
    2020-12-23 19:46

    Use Jquery for append the value for creating dynamically

    eg:

    var user_image1='Thumbnail Image';
    
    $("#userphoto").append(user_image1.replace("{@user_image}","http://127.0.0.1:50075/webhdfs/v1/PATH/"+user_image+"?op=OPEN")); 
    

    HTML :

提交回复
热议问题