-4

I have HTML, jQuery and CSS report.

In static way if wee see the 'view page source' from browser I can see is

<div id='report' class="test-reports-container"> but If I use FireBug in mozilla firefox it show something different like

<div id='report' class="test-reports-container mCustomScrollbar _mCS_1"> 

I don't understand how its changed.

The problem is I am creating dynamic contents so I need to remember className for which I append html content, but at run time className get changed so how would I append the html to some divs?

Can you say how its style get changed at runtime?

Amir
  • 1,328
  • 2
  • 13
  • 27
Sanjay Rabari
  • 2,091
  • 1
  • 17
  • 32
  • 1
    page source only shows static html that is loaded on page load it will not show dynamic content,firebug allows to see the runtime html – Ehsan Sajjad Jun 02 '14 at 12:00
  • *"..but at run time className get changed .."*: No. The classnames do not change, unless they are manipulated by some Javascript. Even then, in your case the class names are not changed. Only a few other class names are added. By any chance are you using an external library? – Abhitalks Jun 02 '14 at 12:03
  • so ehsan if I append code using ajax and jquery which part I need to consider static or dynamic? – Sanjay Rabari Jun 02 '14 at 12:04
  • yes Abhitalks I am using jquery and its scrollbar plugin. – Sanjay Rabari Jun 02 '14 at 12:04
  • 1
    Your html is modified because of the plugin you are using for scrollbar. But that shouldn't be any issue for you. Your predefined classes are not getting affected, only the new classes are added. Even then you can refer your elements using the id. I wonder why did you asked this question given the reputation you have. – K K Jun 02 '14 at 12:05
  • @SanjayRajjadi: There. You answered your question yourself. – Abhitalks Jun 02 '14 at 12:07
  • Google is our best friend , Before posting question one should see on google for these questions . You need to change CSS through JavaScript or Jquery . JavaScript link OR Jquery Link Hope this Helps! – zafus_coder Jun 02 '14 at 12:07

1 Answers1

0

you can append html to test-reports-container class, even when FireBug shows <div id='report' class="test-reports-container mCustomScrollbar _mCS_1">

in this case class name hasn't changed but 2 new classes added to element

now your div element has 3 classes and that are test-reports-container, mCustomScrollbar & _mCS_1