Avatar of ITsolutionWizard
ITsolutionWizard
Flag for United States of America asked on

jquery html

Does jquery with HTML5 has like place holder for html control like below?

<div class="form-group">
                            <label class="col-sm-4 control-label">Bond Amount</label>
                            <div class="col-sm-8">
                                 <object id="container" />
                            </div>
                        </div>


function getBondAmountType(bondState,bondName)
{
    if(bondState=="CA")
    {
 	object = "<input type="text" name="test" id="test">"
    }
    else
    {
	object = "<select type="text" name="test" id="test"></select>"
    }
}

Open in new window

HTMLjQuery

Avatar of undefined
Last Comment
Leonidas Dosas

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Leonidas Dosas

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ITsolutionWizard

ASKER
if bond state = ca, parse html text box
if bond state != ca, parse html select drop down
both will be in one container.
Leonidas Dosas

HTML:
<div class="form-group">
     <label class="col-sm-4 control-label">Bond Amount</label>
            <div class="container col-sm-8"></div>
</div>

Open in new window

JQuery script:
  function getBondAmountType(bondState)
{
  var element;
    if(bondState=="CA")
    {
 	 element ='<input type="text" name="test" id="test">';
      $('.container').append(element);
    }
    else
    {      
	 element ='<select type="text" name="test" id="test"></select>';
      $('.container').append(element);
    }
}

Open in new window

This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23