I have external code which define variable Modal also I can't change this declaration.
var Modal = function (element, options) {
this.options = options
this.$body = $(document.body)
this.$element = $(element)
this.$dialog = this.$element.find('.modal-dialog')
this.$backdrop = null
this.isShown = null
this.originalBodyPad = null
this.scrollbarWidth = 0
this.ignoreBackdropClick = false
if (this.options.remote) {
this.$element
.find('.modal-content')
.load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal')
}, this))
}
}
I want to set value isShown to false.
In this way Modal.isShown=false; but property isShown is not accessible.
How I can access and change it's value.
This is a constructor function. Try the below code.
const modalNew = new Modal(elment,options);
modalNew.isShown = false;
You will need to pass the element and options.