Topic: How to dynamically add or remove chips ?
                  
                  Accident.com
                  pro
                  asked 7 years ago
                
                I want to modify chips in an input using javascript. Can anyone help me with this requirement ?
                
                  
                
                
                
                  
                  
                  
                    
                    
                
              
              
              
            
                      
                        Add comment
                      
                    
                  
                
                      
                      vasanth G
                      free
                        answered 6 years ago
                    
Here I am going to explain how to add chips dynamically.
Add the below line in your html.
 <div class="chips chips-initial"></div>
Add below code into JS function.
var s = "your_input";
var e = jQuery.Event("keydown");
e.which = 13; // # Some key code value
$(".chips-initial input").val(s);
$(".chips-initial input").trigger(e);
$('.chips').material_chip();
Note:Pass Your input into variable s;
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
              Answered
Specification of the issue
              - ForumUser: Pro
 - Premium support: No
 - Technology: MDB jQuery
 - MDB Version: -
 - Device: -
 - Browser: -
 - OS: -
 - Provided sample code: No
 - Provided link: No
 
Tags