Giter VIP home page Giter VIP logo

select-to-datalist's Introduction

Select Bot to Datalist Script

Vanilla JavaScript to convert select boxes to inputs with associated datalists.

What does it do?

The script will go through your document and find instances of data-action="prog-datalist" and convert the following pattern from:

<label for="ex_1" data-action="prog-datalist" data-class="text-input">
  <span class="label__text">
    Label Text:
  </span>
  <!-- <span class="select-box"> -->
    <select id="ex_1" name="ex_1" required>
      <option disabled selected>Select:</option>
      <option>option 1</option>
      <option>option 2</option>
      <option>option 3</option>
    </select>
  <!-- </span> -->
</label>

to

<label for="ex_1" data-action="prog-datalist">
  <span class="label__text">
    Label Text:
  </span>
  <input type="text"
    id="ex_1" 
    name="ex_1" 
    required 
    list="datalist_2121" 
    class="text-input">
  <datalist id="datalist_2121">
    <option>option 1</option>
    <option>option 2</option>
    <option>option 3</option>
  </datalist>
</label>

License & Such

This script was written by Scott O'Hara.

It has an MIT license.

Do with it what you will :)

select-to-datalist's People

Contributors

scottaohara avatar

Watchers

 avatar  avatar  avatar

Forkers

dgbeladiya09

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.