0

I am using tagit plugin for tagging and bootstrap for design in my website. I want to show placeholder text in the tagit input field.

Already tried:

$("#input_id").tagit({placeholder: 'placeholder text'})

But, it is not showing "placeholder text" as default text in tagit input field.

Any help will be appreciated.

Thanks!

3 Answers 3

3

Its solved, i was setting the wrong attribute. Instead

$("#input_id").tagit({placeholder: 'placeholder text'}) 

it should be

$("#input_id").tagit({placeholderText: 'placeholder text'}) 
Sign up to request clarification or add additional context in comments.

Comments

0

HI now you can try to javascript as like this

setAttribute() Method

var rohit = document.getElementById('input_id'); rohit.setAttribute("placeholder", "placeholder text");
<input id="input_id" type="text" >

Comments

0

If you want to show placeholder once use simple:
$("#input_id").tagit({placeholderText: 'Placeholder text'});

or if you want change one dynamic - use:
$("#input_id").data("ui-tagit").tagInput.attr("placeholder", "New placeholder text");

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.