0

I have a highmaps map similar to map bubble and in it I defined a marker with id set to icon6. I try to access this marker by id using jquery with no success I have tried everything and nothing works. the marker is defined in svg as and i can change color in css using fill but not in javascript. here is some of the ones I tried hoping to load the svg document before it loads the js code.

$(document).ready(function() {
    $('#icon6').setAttribute('fill', '#000000');
}); 

and

$(window).load(function() {
    $('#icon6').setAttribute('fill', '#000000');
});

and many others. The svg document is loaded the way highmaps loads it. as in this example:

http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/maps/demo/map-bubble/

user3672795
  • 133
  • 3
  • 9

1 Answers1

0

Try this:

$(document).ready(function() {
    $('#icon6').css({ fill: "#000000" });
});

or this:

$(document).ready(function() {
    $('#icon6').attr('fill', '#000000');
});
jlewkovich
  • 2,725
  • 2
  • 35
  • 49