cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              p 名前
  input#name(type="text" placeholder="名前を入力してください")
p url
  input#url(type="text" placeholder="urlを入力してください")
button#download ダウンロード
            
          
!
            
              window.onload = () => {
  const download =document.getElementById('download');
  const getData = () =>{
    return {
      name: document.getElementById('name').value,
      url: document.getElementById('url').value
    };
  };
  
  download.addEventListener('click', function(){
    const data = getData();
    const blob = new Blob([JSON.stringify(data, null, '  ')],
	{type: 'application\/json'});
    const url = URL.createObjectURL(blob);
    const link = document.createElement('a');
    link.href = url;
    link.download = 'sample.json';
    link.click();
    URL.revokeObjectURL(url);
  });
};
            
          
!
999px
Loading ..................

Console