I
I
Igor2015-12-11 18:13:08
PHP
Igor, 2015-12-11 18:13:08

How can I create a div that, when written into the markup, inserts certain code?

<div id="page">

      <div class="menu">
        <button class="btn" type="button" id="modal_open">Заказать звонок</button>
      </div>

     
                                         

    <div class="modal-overlay" id="modal_window"
             aria-hidden="true" role="dialog"
             aria-labelledby="modal_title">

      <div class="modal-content" id="modal_holder" role="document">

          <h1 id="modal_title">Заказать звонок</h1>
          <form>
            <label for="name">Имя:</label>
            <input type="text" id="name" class="input" placeholder="Ваше имя" />

            <label for="tell">Номер телефона:</label>
            <input type="tell" id="email" class="input" placeholder="Ваш номер телефона" />

            <input type="submit" class='btn' value="Отправить" />
          </form>

        <button class="btn-close" id="modal_close" type="button" aria-label="close">
          &times;
        </button>

      </div> <!-- end .modal-content -->

    </div> <!-- end .modal-overlay -->

here is the html markup that adds a "button" to order a callback.
iet27JI.png
This markup is too cumbersome to insert every time I want to have such a button.
that is, I just want to
get such a button by inserting
PS, I'm on vorpress.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IceJOKER, 2015-12-11
@IgorBee

<button class="btn" type="button" id="modal_open">Заказать звонок</button>
- here is the button, it can be duplicated at least 100 times on the page, but the rest can be written once (call order block)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question