[Fixed]-How to get an element from list based on clicked link in Django Template?

1👍

Using AJAX will solve your problem. See this StackOverflow answer which explains how to do that:

$('a').click(function() { // This is a listener to the link you mentioned.
    $.ajax({
        url: '127.0.0.1:8000/your_ajax_url', // You will need to create a URL for your AJAX call.
        type: 'get', // This is the default though, you don't actually need to always mention it
        success: function(data) {
            alert(data);
        },
        failure: function(data) { 
            alert('Got an error dude');
        }
    }); 
}

Leave a comment