使用jquery在div中添加image / s [英] add image/s inside a div with jquery

查看:868
本文介绍了使用jquery在div中添加image / s的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次点击一个按钮
< button class =xx type =submitid =add_football>添加< / button>



我想添加图片(< img src =img / door-right.png> < div class =ball_footballbox>< img src< / div>



我该如何使用jQuery?

解决方案


$ ('< img src =img / door-right.png>')。appendTo(。ball_footballbox);


Every time I click on a button <button class="xx type="submit" id="add_football">Add</button>

I want to add a image(<img src="img/door-right.png">)inside the <div class="ball_footballbox"><img src</div>

How do I do that with jQuery?

解决方案

Or $('<img src="img/door-right.png">').appendTo(".ball_footballbox");

这篇关于使用jquery在div中添加image / s的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆