Browse - Programming Tips - Bootstrap: get major version

Date: 2019jul25
Language: javaScript

Q.  Bootstrap: get major version

A.

function bsVersion() { const ver = $.fn.tooltip.Constructor.VERSION; const a = ver.split('\.'); return a[0]; // Major }
// Which class should I use to make something not show? function bsGetNoShowClass() { return bsVersion() <= 3 ? 'hidden' : 'd-none'; }
function exampleUse() { $('#mything).addClass(bsGetNoShowClass()); }