Jquery detect commands/Custom BBcode

So I want to be able to detect what a user on my forums writes in a post and change its CSS accordingly. For example, hl color:yellowexample testhl should apply a hightlight to the text: style=background-color: yellow I want the jQuery code to detect hl color: if successful, save the value between the […]

Why my div cant FadeIn on Scroll

I have one container div and I want to FadeIn when scroll position on him. I dont know why my code doesnt work. Here is link on JSFIDDLE http://jsfiddle.net/Q2TYv/2195/ HTML <div class=container-fluid contact nopadding hideme id=contact> <div class=mainContainer> <div class=contacttitle> <hr class=hrtitle><h2 class=fontraleway>CONTACT US<h2><hr class=hrtitle> <div> <span class=subtitle>Wanna ask us something? Use the form below.<span> […]

How can I get the ID of an element using jQuery?

<div id=test><div> $(document).ready(function() { alert($(#test).id); }); Why doesnt the above work, and how should I do this? View More Answer And Comment : Stackoverflow Important: if you are creating a new object with jQuery and binding an event, you MUST use prop and not attr, like this: $(<div>,{ id: yourId, class: yourClass, html: <span><span> }).on(click, function(e) […]

How to duplicate div class color

Im trying to make it comments counter div. If comments as 0 div class is red or more than 0 div class is blue, but javascript duplicating same colors. $(function () { if(parseInt($(.notification-counter).text()) > 0) { $(.notification-counter).hide(); $(.notification-container).addClass(notification-container2); } }); jsfiddle: http://jsfiddle.net/783h57zy/10/ thanks for answers! View More Answer And Comment : Stackoverflow Since there are many […]

As I can send data from one form to another from jquery?

I have the following problem. I have two forms and need the second bailout form the first data Example : Form 1 <form id=form1> <input type=text name=years> <form> Form 2 <form id=form2> <input type=text name=month> <input onclick=sendForm()> <form> <script> function sendForm(){ I need get data from first and second form $(#form2).submit(); } <script> I […]

Cant apply function to every element

I cant apply a function to each #sum on the page using this code: $(document).ready(function() { $(#sum).each(function(index, element) { var sum = $(this).html(); $(element).html(number_format(sum, 2, ,, )); console.log(element); }); }); function number_format(f,c,h,e){f=(f+).replace(^0-9+\-Ee.g,);var b=!isFinite(+f)?0:+f,a=!isFinite(+c)?0:Math.abs(c),j=(typeof e===undefined)?,:e,d=(typeof h===undefined)?.:h,i=,g=function(o,m){var l=Math.pow(10,m);return+Math.round(o*l)l};i=(a?g(b,a):+Math.round(b)).split(.);if(i0.length>3){i0=i0.replace(\B(?=(?:\d{3})+(?!\d))g,j)}if((i1||).length<a){i1=i1||;i1+=new Array(a-i1.length+1).join(0)}return i.join(d)}; It only applies to the first element. DEMO View More Answer And Comment : Stackoverflow Not that […]

How to display dropdown list with values in the datatable while performing inline editing?

I need to display a dropdownlist in a particular cell while performing inline editing and need to load the values in the dropdownlist from the datatbase. I know how to load the values in the dropdownlist outside the datatable. Is this the same process while it is inside the datatable?. Please give me some ideas […]

What is the easiest way to disable/enable buttons and links (jQuery + Bootstrap)

Sometimes I use anchors styled as buttons and sometimes I just use buttons. I want to disable specific clicky-things so that: They look disabled They stop being clicked How can I do this? View More Answer And Comment : Stackoverflow This above does not work because sometimes $(this).attr(checked) == undefined adjust your code with if(!$(this).attr(checked) || […]

get invoked method name and passed in parameters [duplicate]

This question already has an answer here: Get function name in JavaScript 7 answers Is there a way to get method name and passed in parameter in javascript? let function say(param){ alert(param); } so when say method is invoked, say(helloworld) I would get method: say and parameters: {helloworld} View More Answer And Comment : Stackoverflow function […]