locked
get values of tag-input RRS feed

  • Question

  • User448619955 posted

    HI there I'm using customized tag-input which can be found in here.

    I want to get values of entered tags.

     <input id="ms1" style="width:400px;" type="text" name="ms1" />

    how can I get ms1 values from javascript?

    thanks

    Sunday, February 4, 2018 9:00 AM

All replies

  • User-1838255255 posted

    Hi Vahid.Ch,

    After reading your needs and provided link, as far as i know, this is a general input tag, provided link is a jQuery plugin, maybe you apply this plugin to this input tag. You want to get the item text in input tag. I check that code in my side, you could  foreach divs inside this input tag, then get the value: 

    You provided link screenshot: 

     

    My sample code:

    <head runat="server">
        <title></title>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
        <script>
            $(function () {
                $(".Bigbox .box").each(function () {
                    var fruit = $(this).text();
                    alert(fruit);
                })
            });
    
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <div class="Bigbox">
                    <div class="box">
                        apple<span></span>
                    </div>
                    <div class="box">
                        orange<span></span>
                    </div>
                </div>
            </div>
        </form>
    </body>

    Best Regards,

    Eric Du 

    Monday, February 5, 2018 9:43 AM