# Dynamic values in Element Code headers possible?

**URL:** <https://forum.bubble.io/t/dynamic-values-in-element-code-headers-possible/136974>\
**Category:** Plugin builders\
**Created:** [February 18, 2021, 11:20pm UTC](https://forum.bubble.io/t/dynamic-values-in-element-code-headers-possible/136974 "2021-02-18T23:20:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![vini\_brito](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vini_brito/32/22187_2.png) [@vini\_brito](https://forum.bubble.io/u/vini_brito)\
**Post date:** [February 19, 2021, 6:57pm UTC](https://forum.bubble.io/t/dynamic-values-in-element-code-headers-possible/136974/2 "2021-02-19T18:57:38Z")

</div>

While it’s not exactly what you’re asking, you can achieve the same effect in 99% of cases by using an action to append the script or style in the header.  
Here it goes:

To load an external CSS

```auto
    loadCSS = function(href) {

        var cssLink = $("<link>");
        $("head").append(cssLink); //IE hack: append before setting href

        cssLink.attr({
          rel: "stylesheet",
          type: "text/css",
          href: href
        });

      };

      loadCSS("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.2/styles/default.min.css");

```

Now for loading external scripts

```auto
    var script = document.createElement('script');
      script.onload = function () {

      // do whatever you want now that the external script is loaded

      };

      script.src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.2/highlight.min.js";

      document.head.appendChild(script);

```

Now to apply to the page a style you’re creating right now:

```auto
    var sheet = document.createElement('style');

         sheet.innerHTML =

            `.selector {
         color: ${properties.icon_color};
         font-size: ${properties.icon_size}px;
      }`;

          document.head.appendChild(sheet);

```

---

_[View the full topic](https://forum.bubble.io/t/dynamic-values-in-element-code-headers-possible/136974)._
