NVE OL WMS

HTML

<script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"></script>
<link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css">
<div id="map" class="map"></div>

CSS

#map {
  width: 100%;
  height: 100%;
}

JavaScript

var layers = [
  new ol.layer.Tile({
    source: new ol.source.OSM()
  }),
  new ol.layer.Tile({
    source: new ol.source.TileWMS({
      url: 'http://gis3.nve.no/map/services/Nedborfelt1/MapServer/WmsServer?',
      params: {
        'LAYERS': 'Vassdragsomrade'
      },
      attributions: "NVE"
    })
  })
];
var map = new ol.Map({
  layers: layers,
  target: 'map',
  view: new ol.View({
    center: [1402455, 9381155],
    zoom: 5
  })
});