简体   繁体   English

样式化动态创建的html元素

[英]Styling dynamically created html elements

I am trying to add a search in page function with javascript. 我正在尝试使用javascript添加页面功能搜索。 I was looking at this script . 我在看这个剧本

It is creating the input element dynamically inside an iframe to skip the text in the search input box. 它是在iframe中动态创建输入元素,以跳过搜索输入框中的文本。 I have bootstrap running on my project and the dynamic content doesn't get the bootstrap styling. 我在我的项目上运行了引导程序,但是动态内容没有得到引导程序样式。 How can I style the input box and submit button with bootstrap? 如何使用引导程序设置输入框的样式并提交按钮?

Use their respective id to style them(Hope you use firebug to inspect the webpage and get element details) 使用它们各自的ID为它们设置样式(希望您使用firebug来检查网页并获取元素详细信息)

Ex: form#f1 input[type="text"] { backgroud-color:#222222 !important;} 例如: form#f1 input[type="text"] { backgroud-color:#222222 !important;}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM