How to change the attribute value "a" when you click?

how to change the attribute value "a" when clicking(change city)
jsfiddle.net/orpbm9an
September 19th 19 at 13:10
3 answers
September 19th 19 at 13:12
Solution
$('.city_select_list a').on('click', function(){
$(".search a").html($(this).attr('title'));});


do not forget to mark as solution !
Code is to write correctly, not so bad.
Learn how to arrange the code in a code tag instead of writing all together. - minerva.Kassul commented on September 19th 19 at 13:15
: don't bother guy, he's in pursuit of karma you see )))) - alici commented on September 19th 19 at 13:18
: I didn't know that there is such a tag,,, thank you - imelda.Wintheis commented on September 19th 19 at 13:21
: Well, as it is very busy and wants in a short time sensitive pokoritsya)) - imelda.Wintheis commented on September 19th 19 at 13:24
not working jsfiddle.net/unior27/orpbm9an/3 - Manuela.Ho commented on September 19th 19 at 13:27
It does not work ? Dude let me understand how it should work ? The LOGIC description )) - imelda.Wintheis commented on September 19th 19 at 13:30
:there is a line "Search of work in Moscow"
underneath the column with the list of cities.
problem:clicking on any of the cities list in the line "Search of work in Moscow" the city should switch to the appropriate(which is clicked)
(for example clicked on "Barnaul", and the line became "job Search in the city of Barnaul") - Manuela.Ho commented on September 19th 19 at 13:33
: See the answer - minerva.Kassul commented on September 19th 19 at 13:36
$('.city_select_list a').on('click', function(){
$(".search a").html($(this).attr('title'));
}); - imelda.Wintheis commented on September 19th 19 at 13:39
https://jsfiddle.net/orpbm9an/4/ - imelda.Wintheis commented on September 19th 19 at 13:42
: and so it was necessary) - Manuela.Ho commented on September 19th 19 at 13:45
My answer is the correct one, it wool)) I'm just not a mind reader - imelda.Wintheis commented on September 19th 19 at 13:48
: Well, well. She says all right, with observance of all norms of the code on jquery, with comments.
You do the same - today I read what is jquery and how do not understand how to work with it.
I am sure that JS you have even worse. - minerva.Kassul commented on September 19th 19 at 13:51
: Well, it is important that the author of a topic found solutions in my answer,,, and for correct writing code in any language I recommend to all sublime text www.sublimetext.com/3 - imelda.Wintheis commented on September 19th 19 at 13:54
: brackets , webstorm, etc.
The latest build of Sublime unstable. And what Sublime can help to write code ?
the debugger is not there. - minerva.Kassul commented on September 19th 19 at 13:57
: Package's also not on this topic. - minerva.Kassul commented on September 19th 19 at 14:00
: I open up the script lying on the server through WinSCP on Sublime and they are saved directly on the server which gives the ability to use the debugger of the browser (particularly with client scripts) ... but for the server scripts I have your programer is :) - imelda.Wintheis commented on September 19th 19 at 14:03
What do you do? Open on the server?
You "father" of development, I have nothing more to add.
If in my team for once someone did, I at least was thrown off the team. - minerva.Kassul commented on September 19th 19 at 14:06
: You don't give personal space to employees, do not give itself chance of implementations that build them. I will assume the job they have to perform are quite simple and banal. I therefore it to you in the team do not climb and I'm not a robot and not a machine to me as used! - imelda.Wintheis commented on September 19th 19 at 14:09
September 19th 19 at 13:14
// Write the objects into variables
var $listPoints = $('.city_select_list').find('a');
var $search = $('.search');

$listPoints.on('click', function() {
 // Save the selected date in a variable that may need manipulation
 var newData = $(this).data('big');
 // Add title="Kirov"
$search
.find('a')
 .attr('title', newData);
 // Added for clarity to the document 
 // You can remove
$search.find('a').html(newData)
});


jsfiddle.net/9p8kwwe5/2
I read your answers - very worthy for girls! And good style. - minerva.Kassul commented on September 19th 19 at 13:17
Will you marry me? - alici commented on September 19th 19 at 13:20
: Thank you.
The boss won't allow it. Well, you are from the Bryansk region, but it is =) - imelda.Wintheis commented on September 19th 19 at 13:23
: well =( - imelda.Wintheis commented on September 19th 19 at 13:26
September 19th 19 at 13:16
doesn't work! - minerva.Kassul commented on September 19th 19 at 13:19
: works, you just don't see - alici commented on September 19th 19 at 13:22
how) how to see))? - imelda.Wintheis commented on September 19th 19 at 13:25
: you want to change the title of the first link - imelda.Wintheis commented on September 19th 19 at 13:28
for more mundane a little more ? - Manuela.Ho commented on September 19th 19 at 13:31

Find more questions by tags HTMLCSSjQuery