title: Dynamically change style of a site running in EXPRESS js and NODE js
body: <p>I have a basic site running with node.js and express.js. I followed this <a href="http://shapeshed.com/creating-a-basic-site-with-node-and-express/" rel="nofollow">tutorial</a> to get it done. </p>
  
  <p>Express implementations looks like this. I have jade file for a web interface.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// app.js
  var express = require('express'),
    routes = require('./routes'),
    user = require('./routes/user'),
    http = require('http'),
    path = require('path');
  
  var app = express();
  
  app.configure(function(){
    app.set('port', process.env.PORT || 3000);
    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');
    app.use(express.favicon());
    app.use(express.logger('dev'));
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(app.router);
    app.use(require('stylus').middleware(__dirname + '/public'));
    app.use(express.static(path.join(__dirname, 'public')));
  });
  
  app.configure('development', function(){
    app.use(express.errorHandler());
  });
  
  app.get('/', function(req, res){
    res.render('index', {
      title: 'Home'
    });
  });
  
  http.createServer(app).listen(app.get('port'), function(){
    console.log("Express server listening on port " + app.get('port'));
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code># index.jade
  html
    head
      title iDesk
      style.
        .available{
        background: #3db72f;
        }
        .occupied{
        background: red;
        }
    body
      table(width='40%')
        caption Table #01
        tr
          td#sec_01.available
      br</code></pre>
  </div>
  </div>
  </p>
  
  <p>I also have another javascript that fetches a value from bluetooth. It has an infinite while loop and should be continuously run in node.js. And with the values it fetches, I want to dynamically change the style of the web interface. For example, when the value fetched from bluetooth is <code>1</code>, I want to change class style. ie. <code>document.getElementById("set_01").className = "occupied";</code></p>
  
  <p>How can I possibly combine these two features? Should they run seperately and find some way to transfer data to each other? Or can bluetooth.js be included in express.js and run in node altogether? I am new to both express and node js... Your help would be greatly appreciated... Thank you!</p>