Forum Moderators: open
$(document).ready(function(){
$('.sub .reply-link').append('<a href="javascript:void(0);"' + '" onclick="mtReplyCommentOnClick(' + '2633' + ',' + '\'user name\')">Reply to thread</a>'); // 2633 is a dummy value. I need to replace it with value of replyToId.
$('.reply-link a').click(function(){ // This is just in the click event because I'm not sure how to do it when the page loads.
var parentCommentId = $(this).parents('div.comment').attr("id"); // Get the ID of the div containing the parent comment
var replyToId = parentCommentId.replace(/comment-/, '') // This gives me the same value as the Comment's ID within Movable Type
alert(replyToId); // Just for testing - Fire an alert to make sure I'm getting the ID
});
});