Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. createElement, custom style, turn off webkit Appearance

createElement, custom style, turn off webkit Appearance

Scheduled Pinned Locked Moved JavaScript
javacssiostoolstutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jkirkerx
    wrote on last edited by
    #1

    I made a button in Java Script, and I'm trying to figure out how to turn off the -webkit-appearance so Safari IOS won't turn the button into a rounded button. I found borderRadius. I want put it inline, instead of modifying the class in the css file, I just need it in one spot. I looked around but didn't really find anything, most searches produced beginner stuff.

    var input_Close = document.createElement("input");
    input_Close.id = "_bt_pv_close";
    input_Close.type = "button";
    input_Close.className = "g-button black";
    input_Close.style.width = '112px';
    input_Close.style.height = '32px';
    input_Close.style.borderRadius = '0';
    input_Close.style.fontSize = "1.0em";
    input_Close.value = "close";
    input_Close.size = "30";
    input_Close.onclick = function () { sm_unload_Modal_PhotoViewer(); };
    div_Close.appendChild(input_Close);

    S 2 Replies Last reply
    0
    • J jkirkerx

      I made a button in Java Script, and I'm trying to figure out how to turn off the -webkit-appearance so Safari IOS won't turn the button into a rounded button. I found borderRadius. I want put it inline, instead of modifying the class in the css file, I just need it in one spot. I looked around but didn't really find anything, most searches produced beginner stuff.

      var input_Close = document.createElement("input");
      input_Close.id = "_bt_pv_close";
      input_Close.type = "button";
      input_Close.className = "g-button black";
      input_Close.style.width = '112px';
      input_Close.style.height = '32px';
      input_Close.style.borderRadius = '0';
      input_Close.style.fontSize = "1.0em";
      input_Close.value = "close";
      input_Close.size = "30";
      input_Close.onclick = function () { sm_unload_Modal_PhotoViewer(); };
      div_Close.appendChild(input_Close);

      S Offline
      S Offline
      Sunasara Imdadhusen
      wrote on last edited by
      #2

      Why you are not adding whole style to the object in single line of code!

      J 1 Reply Last reply
      0
      • J jkirkerx

        I made a button in Java Script, and I'm trying to figure out how to turn off the -webkit-appearance so Safari IOS won't turn the button into a rounded button. I found borderRadius. I want put it inline, instead of modifying the class in the css file, I just need it in one spot. I looked around but didn't really find anything, most searches produced beginner stuff.

        var input_Close = document.createElement("input");
        input_Close.id = "_bt_pv_close";
        input_Close.type = "button";
        input_Close.className = "g-button black";
        input_Close.style.width = '112px';
        input_Close.style.height = '32px';
        input_Close.style.borderRadius = '0';
        input_Close.style.fontSize = "1.0em";
        input_Close.value = "close";
        input_Close.size = "30";
        input_Close.onclick = function () { sm_unload_Modal_PhotoViewer(); };
        div_Close.appendChild(input_Close);

        S Offline
        S Offline
        Sunasara Imdadhusen
        wrote on last edited by
        #3

        Can you please use following:

        var div = document.createElement('div');
        div.setAttribute('style', 'width:330px; float:left');

        1 Reply Last reply
        0
        • S Sunasara Imdadhusen

          Why you are not adding whole style to the object in single line of code!

          J Offline
          J Offline
          jkirkerx
          wrote on last edited by
          #4

          I was a complete newbie to writing HTML in the DOM, and I sort of used that style as the next step of advancement. I couldn't remember the attribute and could not find it through search. I knew there was a one liner for inline style. I was hoping to keep it the same, but I'll convert to your post example. Thanks for the reminder!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups