Tag: class

Javascript & Ajax

Change HTML class attribute using javascript

To change an element’s class attribute using javascript do the following: document.getElementById("id").setAttribute("class", "myclassname");document.getElementById("id").setAttribute("class", "myclassname"); or document.getElementById("id").className = "myclassname";document.getElementById("id").className = "myclassname";

PHP, WEB

Create a zip file using PHP and ZipArchive class

You can create zip archives in PHP using ZipArchive class. public function createZipArchive($files, $archive, $overwrite) { $zip = new ZipArchive (); if ($overwrite) $flags = ZipArchive::CREATE | ZipArchive::OVERWRITE; else $flags = ZipArchive::CREATE; if (($zip->open ( $archive, $flags )) !== true) { return false; } else { foreach ( $files as $file ) { if (file_exists …