JSFiddle - React, Tailwind, and code Playground

by velmurugansp

HTML

<input type="text" id="shipping:firstname" name="billing[firstname]" value=""/>

JavaScript

$(window).ready(function(){
    var text_to_get='firstname';
    var targetID = '#shipping['+text_to_get+']';
    $(targetID).val("10");
});