Increase font of content written in input

2

Hello, I'm new to Java Web programming, I'm developing an application in which I want to write an input word, I want to select that word and increase that font, how can I do that? I'm in doubt: /

My select where to select which font:

 <select id="SelectAlterarFonte" class="form-control">
                                                <option value="12">Fonte 12</option>
                                                <option value="18">Fonte 18</option>
                                            </select>

My input where I will type.

 <h:inputText value="#{frameBean.objSvg.valueText1}" autocomplete="off" id="AlterarTxto"
                                                     styleClass="form-control" tabindex="0"/>

And finally. I want to click this button and do the action:

  <p:commandLink id="btn_close_users_modal3"
                                               styleClass="btn btn-default" 
                                               validateClient="false" process="@this">
                                    <i class="fa fa-floppy-o fa-fw" /> #{bundle['system.ui.label.save']}
                                </p:commandLink>
    
asked by anonymous 16.06.2015 / 16:40

1 answer

2

Would that be it? I did with pure HTML and JS, adapt as needed.

function alteraTexto() {
    var tamanhoSelecionado = document.getElementById('SelectAlterarFonte').value;
    document.getElementById('AlterarTxto').style.fontSize = tamanhoSelecionado + "px";
}
 <select id="SelectAlterarFonte" class="form-control">
     <option value="12">Fonte 12</option>
     <option value="18">Fonte 18</option>
</select>

<input type="text" value="Texto" autocomplete="off" id="AlterarTxto" styleClass="form-control" tabindex="0"/>

<input type="button" value="Alterar" onclick="alteraTexto()"/>
    
16.06.2015 / 17:45