JSFiddle - React, Tailwind, and code Playground

by rwaldron

HTML

<input id="testid" name="tester" value="abc" type="text" />

JavaScript

// #9646 (IE7 only)

// Form-element that is copied gets the copied
// element's name if the name attribute of the
// element to be copied is first accessed.


// ***  Remove comment to see the bug ****
$('#testid').attr("name");

$('#testid')
  .clone(true)
    .attr("id", "foo")
    .attr("name", function(index, attr) {
         return attr  +  "_copied";
    })        
    .val(function() {
        return this.name + " " + this.id;
    })
    .insertAfter('#testid');