Using Jquery to change attribute title

Posted on 2011-10-10
Last Modified: 2013-11-05
Hello experts.
I need help to replace the content of a attr. title with the response after ajax call.
(my enable_reset_action.cfm is returning a value like:Lastenable:10/10/2011 ) wich i want to use for title="Lastenable:12/08/2011")

Please check if the way i'm trying to do this is (1.get the id value and 2.pass it to the action page 3.use the response) is the right way.

Notice that i can't use : $("#resetid_BE674161-D89C-AA62-077B1DA2E6C8D4AE") for the a tag id because it is a value from an output query.

below is my code.
Any help?
<style type="text/css">.red{color:#F00;}.orange{color:#F90;}.green{color:#0F3;}</style>
<script type="text/javascript" language="javascript" src="../js/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
var enableitem = function(id){
  var atagid = '#resetid_' + id;
			type: "GET",  
			url: "customer_items/includes/enable_reset_action.cfm",  
			data: {art_id: id },  
			success: function(theResponse) {
			 // $(atagid).attr("title").(theResponse);
<a id="resetid_BE674161-D89C-AA62-077B1DA2E6C8D4AE" onclick="enableitem('BE674161-D89C-AA62-077B1DA2E6C8D4AE');return false;" class="fg-button ui-state-default ui-corner-left blink red" title="Lastenable:12/08/2011" href="#"><b>Enable</b></a>

Open in new window

Question by:Panos
    LVL 15

    Accepted Solution

    // $(atagid).attr("title").(theResponse);

    Should be:

    $(atagid).attr("title", theResponse);
    LVL 2

    Author Comment

    Hi dirknibleck
    It was very close!
    Thank you for your help. It is working now.
    LVL 2

    Author Closing Comment

    Thank you .
    Regards panos

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    Title # Comments Views Activity
    Problem to Popup 37 61
    php session question (Code Igniter) 5 22
    Issues with signature 19 16
    jquery not selector 1 3
    Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question ( on how to make a page show some balloons animate up a page…
    There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now