0

Is it possible to assign values which I have in Jquery variable to Title of elements?

E.g. var params will have value Assigned, Assignee etc.

How can I set the title of element?

1 Answer 1

3

You can use title attribute

Using jQuery object

$('#yourElement').attr('title', varibleval);

Using javascript DOM object

$('#yourElement')[0].title = varibleval;
Sign up to request clarification or add additional context in comments.

3 Comments

Or .prop("title",variable)
That is the original Dom object
Keep in mind that the title attribute is reserved for tooltips and you should use data-title instead to adhere to current conventions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.