Disable <p> with JQuery

<p style="" class="closeField float_left" disabled="true"> 
  <a href="/knome2/comments/115/report_abuse" class="btn lbOn"><span class="button_image">
  <span class="report_abuse background_16">Close</span></span></a>
</p>

      

I am trying to make this <p>

disabled. In fact, this tag <p>

will render as a button using CSS ...

How do I make a tag <p>

disabled in JQuery?

+2


source to share


4 answers


The best way to create an element that looks like a disabled button is to create a disabled button. Did you know that the tag <button>

allows you to insert complex html into it?



+6


source


if you use this P for a click event and you mean "disable" to stop the event.

then you can cancel the $ ("p") event. unbind ("click")



or if you want to decrease the opacity as if it were off, you can set the opacity via $ ("P"). CSS ("Blurred", 0.7), or you can animate the opacity via animate $ ("p"). fadeTo ("slow", 0.7);

Does this solve the problem?

+2


source


You need to create a disabled style in CSS and then apply it with jQuery

0


source


you can use $('p').remove()

or $('p').empty()

if you want to disappear by disconnection.

-1


source







All Articles