Let's say I have the following jQuery code. It works great, but then I need to include the .after($('<div />'))
only if var insertAfter
equals true. Is there an elegant jQuery way of doing this?
$('#whatEver')
.parent()
.show()
.width(123)
.addClass('bebo')
.before($('<div />'))
.after($('<div />'))
.parent()
.addClass('bla');