So if I understand you correctly, you don't want the button to be grayed out, but when the user clicks on it, you want it to do nothing?
I don't think that's good usability. Buttons which don't do anything are confusing to users. In my opinion it would be better to disable the button after the user clicks it once. That shows the user that there is no point in clicking it again.
Monica. Shiralkar wrote:I do not want to restrict the user from clicking the button again.
I never suggested you should, I said change the behaviour of the button.
Monica. Shiralkar wrote:If the user clicks button it should display some information. Now if the user clicks this button again it should not keep displaying this information once again below it and so on.
Then don't. This displaying of information is not some natural behaviour of HTML that you're fighting against, it's a behaviour you've implemented. Your code is what is "displaying this information once again below", add a condition to your code so it doesn't.
If you want help with your code then you'll have to post it, we can't guess what your code is.
You're adding a div or a span element on your ajax callback, I assume. In this case, just check if that div is already there, and if so, don't do the ajax call. Either that or replace the div instead of adding it.
Think about it. How would you do this? You can do it in a thousand ways.