简体   繁体   中英

allow specific attributes in html tags online tool

I've been googling to find an online tool to strip specific attributes in an html tag, but I couldn't find something useful.
for example let's imagine that we have an input like this:

<input type="radio" value="1" name="some-name-1" class="form-control"/>
<input type="text" value="" name="some-name-2" class="form-control"/>

And I need to remove every value and name attributes in all tags, and convert it to:

<input type="radio" class="form-control"/>
<input type="text" class="form-control"/>

Is there anything you can recommend?

Using JQuery you can do the following: https://jsfiddle.net/wwWaldi/7g6hyj4f/8/

$('#remove').on('click', function(){
  $('input').attr('value', '').attr('name', '');
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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