Answer the question
In order to leave comments, you need to log in
How to replace a piece of code with Jquery so that it always displays a certain text?
createDOM: function () {
var nav = this;
$('body')
.append($('<div/>', {
'class': settings.cntClass
}).append(nav.createNavDOM()))
.append($('<div/>', {
'class': settings.panelClass
})
.append($('<button/>', {
'class': settings.toggleClass
}).append($('<span/>')))
.append($('<h2/>', {
'class': settings.titleClass
}).append($('[data-type="rd-navbar-brand"]').length? $('[data-type="rd-navbar-brand"]').html() : document.title))
);
}
.append($('[data-type="rd-navbar-brand"]').length? $('[data-type="rd-navbar-brand"]').html() : document.title))
This line does the conversion, but I need it to insert there not the length of this element, but the text, for example: 'Jquery'
Answer the question
In order to leave comments, you need to log in
.apppend('ваш текст');
Or (if you edit the current one):.append(text);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question