如何从html中删除#shadow-root(user-agent) [英] how to remove #shadow-root (user-agent) from html

查看:5245
本文介绍了如何从html中删除#shadow-root(user-agent)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是#shadow-root(user-agent)?如何从文本框中删除它?



详细

这是我的代码:

 < input type =textname =pincodeclass =form-control frm_pincodevalue =/> 

但是当我检查它,我看到像

 < input type =textname =pincodeclass =form-control frm_pincodevalue => 
#shadow-root(user-agent)
< div id =inner-editor>< / div>
< / input>


解决方案

本质上它封装了代码,使其更易于管理。这不一定是您要删除的东西,而不会使代码生成不可用的功能。



以下是库中隐藏的代码你正在使用,所以你不必担心编码某些对象。 Chrome允许您查看代码中#shadow Dom的位置。

 #shadow-root(user-agent)
< div id =inner-editor>< / div>

从以下链接中查看此解释:


简而言之,影子DOM是HTML规范的一个新部分,允许
开发人员封装其HTML标记,CSS样式和
JavaScript。Shadow DOM还有一些其他的技术,以后我们将介绍
,让开发人员能够像自己的标签一样构建自己的第一个
类标签和API
这些新的标签和API被称为Web
组件。


下面的链接是帮助了解影子DOM的关键:

http://robdodson.me/blog/2013/08 / 26 / shadow-dom-introduction /



这样可以利用阴影DOM创建自定义标签:

< a href =https://www.polymer-project.org/ =nofollow> https://www.polymer-project.org/



最后,Chrome开发工具选项下还有一个显示用户代理shadow DOM选项


What is #shadow-root (user-agent)? how to remove it from text boxes?

In Detail
This is my code:

<input type="text" name="pincode" class="form-control frm_pincode" value="" />

But when I inspect it I see like

<input type="text" name="pincode" class="form-control frm_pincode" value="">
  #shadow-root (user-agent)
  <div id="inner-editor"></div>
</input>

解决方案

Essentially it encapsulates code, making it more manageable. It's not necessarily something you're going to want to remove without making the functionality of the code you did generate unusable.

The following is code is hidden from you by the library you're using so you don't have to worry about coding certain objects. Chrome allows you to see where those #shadow Doms are located in the code.

  #shadow-root (user-agent)
  <div id="inner-editor"></div>

Check out this explanation from the link below:

"In a nutshell Shadow DOM is a new part of the HTML spec which allows developers to encapsulate their HTML markup, CSS styles and JavaScript. Shadow DOM, along with a few other technologies which we’ll cover later, gives developers the ability to build their own 1st class tags and APIs just like the or tag. Collectively, these new tags and APIs are referred to as Web Components."

The link below was key in helping understanding shadow DOM:
http://robdodson.me/blog/2013/08/26/shadow-dom-introduction/

This makes use of the shadow DOM to make creating custom tags possible:
https://www.polymer-project.org/

Finally, there's also an option under Chrome Dev Tools Options to "Show user agent shadow DOM"

这篇关于如何从html中删除#shadow-root(user-agent)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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