473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Friends I am new here I have a question code of JQ

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>Page Title</title>
  4. <script src="https://code.jquery.com/jquery-3.1.1.js"></script>
  5. </head>
  6. <body>
  7. <p value="223">JQuery is </p>
  8.  
  9. <!--!The code prints an integral number like 4! But I'm actually a decimal number 4.4-->
  10.  
  11. <p value="4.4">JQuery is </p> 
  12. <div></div>
  13.  
  14. </body>
  15.  
  16.  
  17. <script type="text/javascript">
  18.  
  19. $( document ).ready(function() {
  20. var arr=new Array(); $('p').each(function() { 
  21. $(this).click(function() {
  22. arr.push($(this).attr("value"));
  23.  
  24. var total = 0;
  25. $.each(arr,function(i) {
  26. total += arr[i] << 0;
  27.  
  28. $("div").html(total);
  29. });
  30. });
  31. });
  32. });
  33.  
  34. </script>
  35.  
  36. </html>
Mar 11 '17 #1
1 1006
Dormilich
8,658 Expert Mod 8TB
What is your question?
Mar 13 '17 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: jr | last post by:
I'm currently using the msnp.py code from Manish Jethani's project. I havn't been able to get the friends list to update like it should. it works once out of about every 25 times the program loads....
11
by: Micha | last post by:
Hello there, I think I've run into some classic c++ pitfall and maybe some of you guys can help me out. For my project I will need to use matrices and vectors and so I decided to implement them...
6
by: (Pete Cresswell) | last post by:
I'm makeing a little DB to help manage high school class reunions. One feature I'm trying to implement is "Friends". e.g. Fred Smith is a friend of Joe Jones and Bill Anderson. We record...
2
by: Kiki | last post by:
Hi, just a small question. I've just looked at a friends code and he's done this: int rowsAffected = sql.ExecuteNonQuery("stored_procedure", cmdParams); if(rowsAffected < 1) { return false; }...
245
by: Vortex Soft | last post by:
http://www.junglecreatures.com/ Try it and tell me what's happenning in the Microsoft Corporation. Notes: VB, C# are CLS compliant
11
by: zhangzhan | last post by:
hello.everyone,i am an chinese.i study in shanxi unniversity,as i like english very much,i also wanr to make friends with a foriger. .....i really don't kown what i should to say ,as i first came...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
3
by: shaun roe | last post by:
Hello, I am working in a framework with certain restrictions; in particular I have a 'data' class with getter and setter methods, and a some 'filling' classes which know how to insert the data to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.