I have a situation where I need to remember what the value of a tagsinput field was before changes were made. However, some of the information is dynamically binded so when the input changes so does the value of my variable that references it.
var topics = $("#topics").tagsinput('items');
$('#topics').tagsinput('add', 'A');
$('#topics').tagsinput('add', 'B');
var LISA = topics;
alert('Lisa is: ' + JSON.stringify(LISA));
$('#topics').tagsinput('add', 'newone');
alert('Lisa is: ' + JSON.stringify(LISA));
So what I'd like is the variable Lisa
to not have newone
added to it.
But with the bootstrap tags input jQuery plugin the variable changes dynamically with the values. Anyone know how to turn off this binding so I can recall what the value of the field was before new information is added?