[英]I would like to add content to the popover on init instead of inline
How can I add content
on inititialization?如何在初始化时添加
content
?
$(document).ready(function(){
$('[data-toggle="popover"]').popover({
trigger: 'click',
html: true,
placement:'top',
content: 'sjk hgksjhdlgkjlskjklg' // Here
})
});
You can use content
attribute and if you want to add HTML
, please add html: true
.您可以使用
content
属性,如果要添加HTML
,请添加html: true
。
$('[data-toggle="popover"]').popover({
trigger: 'click',
html: true,
placement:'top',
content: "My Text"
});
Here is the nice example of it, https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_ref_js_popover_title_content&stacked=h这是一个很好的例子, https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_ref_js_popover_title_content&stacked=h
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.