JavaScript Remove attribute in all children elements recursively

I have this html:

<tr id="Estuches_1">
    <td>
        <div class="group">
            <input name="VariableDataList[0].VariableDataForLevel[0].ProductionOrderId" id="VariableDataList_0__VariableDataForLevel_0__ProductionOrderId" >
            <input name="VariableDataList[0].VariableDataForLevel[0].AggregationLevelConfigurationId" id="VariableDataList_0__VariableDataForLevel_0__AggregationLevelConfigurationId">
            <select name="VariableDataList[0].VariableDataForLevel[0].VariableDataId" disabled="disabled" id="VariableDataList_0__VariableDataForLevel_0__VariableDataId">
                <option value="00">Serial Shipping Container Code(SSCC-18)</option>
                <option value="01" selected="">Global Trade Item Number</option>
                <option value="10">Batch or lot number</option>
                <option value="11">Production date(YYMMDD)</option>
                <option value="17">Expiration date(YYMMDD)</option>
                <option value="21">Serial number</option>
            </select>
        </div>
    </td>
    <td>
        <div class="group">
            <input name="VariableDataList[0].VariableDataForLevel[0].Value" disabled="disabled" id="VariableDataList_0__VariableDataForLevel_0__Value">
            <span class="field-validation-valid" data-valmsg-replace="true" data-valmsg-for="VariableDataList[0].VariableDataForLevel[0].Value"></span>
        </div>
    </td>
</tr>

In Javascript, I have a var named clone that create with the above html.

I want to remove the attribute disabled in all of the elements in the html (one in the select, and another one in the input text).

I have tried this:

var clone = $($.parseHTML(html));
clone.removeAttribute("disabled");

But it doesn't remove any of them. Maybe, because it is trying to remove the disabled attribute in the tr.

How can I remove the disabled attribute in all of the elements?

The id and the name of the elements will change.

Answer:1

I have the following css strings that I am trying to parse using a RegExp. I understand how to split on the comma. How do I work with the result to return an array or string? I guess I'm missing ...

I have the following css strings that I am trying to parse using a RegExp. I understand how to split on the comma. How do I work with the result to return an array or string? I guess I'm missing ...

  1. regex pattern group
  2. regex pattern group java
  3. regex group pattern matching
  4. regex repeating pattern group
  5. python regex pattern group
  6. java regex pattern group example
  7. regex pattern optional group
  8. java regex pattern group name
  9. awk regex pattern group
  10. c# regex pattern group
  11. javascript regex pattern group
  12. regex get pattern group
  13. java.util.regex.pattern group
  14. java regex pattern matcher group example
  15. scala regex pattern matching groups
  16. java regex pattern match group
  17. java regex pattern matcher group
  18. java regex pattern capture group
  19. java.util.regex.pattern$grouptail.match
  20. java.util.regex.pattern$grouphead.match

I'm coding out a temperature app with React and I'm on the part where I'm displaying the different temperatures within the element. Now I'm trying to do &deg;F to return Fahrenheit, but then it ...

I'm coding out a temperature app with React and I'm on the part where I'm displaying the different temperatures within the element. Now I'm trying to do &deg;F to return Fahrenheit, but then it ...

I wanted to convert an array to a textfile with a newline separating each entry. I found out about an npm package called array-to-txt-file. Here is the webpage: array-to-txt-file This package claims ...

I wanted to convert an array to a textfile with a newline separating each entry. I found out about an npm package called array-to-txt-file. Here is the webpage: array-to-txt-file This package claims ...

  1. node.js array to text file
  2. node red dashboard text array

I've read that having an async inside a Promise is anti-pattern for async/await. The code below works, but I am curious how else to achieve the same result without having async in Promise. If I ...

I've read that having an async inside a Promise is anti-pattern for async/await. The code below works, but I am curious how else to achieve the same result without having async in Promise. If I ...